ICAL. RecurIterator

An iterator for a single recurrence rule. This class usually doesn't have to be instanciated directly, the convenience method ICAL.Recur#iterator can be used.

Constructor

new RecurIterator(options)

Creates a new ICAL.RecurIterator instance. The options object may contain additional members when resuming iteration from a previous run.

Parameters:
NameTypeDescription
optionsObject

The iterator options

Properties
NameTypeAttributesDescription
ruleICAL.Recur

The rule to iterate.

dtstartICAL.Time

The start date of the event.

initializedBoolean<optional>

When true, assume that options are from a previously constructed iterator. Initialization will not be repeated.

Members

completed :Boolean

True when iteration is finished.

Type:
  • Boolean

dtstart :ICAL.Time

The start date of the event being iterated.

last :ICAL.Time

The last occurrence that was returned from the ICAL.RecurIterator#next method.

occurrence_number :Number

The sequence number from the occurrence

Type:
  • Number

rule :ICAL.Recur

The rule that is being iterated

Methods

fromData(options)

Initialize the recurrence iterator from the passed data object. This method is usually not called directly, you can initialize the iterator through the constructor.

Parameters:
NameTypeDescription
optionsObject

The iterator options

Properties
NameTypeAttributesDescription
ruleICAL.Recur

The rule to iterate.

dtstartICAL.Time

The start date of the event.

initializedBoolean<optional>

When true, assume that options are from a previously constructed iterator. Initialization will not be repeated.

next() → {ICAL.Time}

Retrieve the next occurrence from the iterator.

Returns:
Type: 
ICAL.Time

ruleDayOfWeek(dow, aWeekStartopt)

Parameters:
NameTypeAttributesDescription
dow

(eg: '1TU', '-1MO')

aWeekStartICAL.Time.weekDay<optional>

The week start weekday

Returns:

[pos, numericDow] (eg: [1, 3]) numericDow is relative to aWeekStart

toJSON() → {Object}

Convert iterator into a serialize-able object. Will preserve current iteration sequence to ensure the seamless continuation of the recurrence rule.

Returns:
Type: 
Object