Constructor
new RecurExpansion(options)
Creates a new ICAL.RecurExpansion instance.
The options object can be filled with the specified initial values. It can also contain additional members, as a result of serializing a previous expansion state, as shown in the example.
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | Recurrence expansion options Properties
|
- Source
// assuming event is a parsed ical component
var event;
var expand = new ICAL.RecurExpansion({
component: event,
dtstart: event.getFirstPropertyValue('dtstart')
});
// remember there are infinite rules so it is a good idea to limit the scope of the iterations
// then resume later on.
// next is always an ICAL.Time or null
var next;
while (someCondition && (next = expand.next())) {
// do something with next
}
// save instance for later
var json = JSON.stringify(expand);
//...
// NOTE: if the component's properties have changed you will need to rebuild the class and start
// over. This only works when the component's recurrence info is the same.
var expand = new ICAL.RecurExpansion(JSON.parse(json));
Members
complete :Boolean
True when iteration is fully completed.
- Boolean
- Source
dtstart :ICAL.Time
Start date of recurring rules.
- Source
last :ICAL.Time
Last expanded time
- Source
Methods
fromData(options)
Initialize the recurrence expansion from the data object. The options object may also contain additional members, see the constructor for more details.
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | Recurrence expansion options Properties
|
- Source
next() → {ICAL.Time}
Retrieve the next occurrence in the series.
- Source
- Type:
- ICAL.
Time
toJSON() → {Object}
Converts object into a serialize-able format. This format can be passed back into the expansion to resume iteration.
- Source
- Type:
- Object