Class 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.

Alias

ICAL.RecurIterator

Hierarchy

  • RecurIterator

Constructors

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

    Parameters

    • options: RecurIteratorData

      The iterator options

    Returns RecurIterator

Properties

by_data: Record<string, any>

The initialized by-data.

by_indices: Record<string, number>

The indices used for the ICAL.RecurIterator#by_data object.

completed: boolean = false

True when iteration is finished.

days: number[]

The expanded year days

days_index: number = 0

The index in the ICAL.RecurIterator#days array.

dtstart: Time

The start date of the event being iterated.

initialized: boolean = false

If true, the iterator has already been initialized

last: Time

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

occurrence_number: number = 0

The sequence number from the occurrence

rule: Recur

The rule that is being iterated

CONTRACT: number = 1
EXPAND: number = 2
ILLEGAL: number = 3
UNKNOWN: number = 0
_expandMap: {
    DAILY: number[];
    HOURLY: number[];
    MINUTELY: number[];
    MONTHLY: number[];
    SECONDLY: number[];
    WEEKLY: number[];
    YEARLY: number[];
} = ...

Type declaration

  • DAILY: number[]
  • HOURLY: number[]
  • MINUTELY: number[]
  • MONTHLY: number[]
  • SECONDLY: number[]
  • WEEKLY: number[]
  • YEARLY: number[]
_indexMap: Record<RecurRuleName, number> = ...

Methods

  • Private

    NOTES: We are given a list of dates in the month (BYMONTHDAY) (23, etc..) Also we are given a list of days (BYDAY) (MO, 2SU, etc..) when both conditions match a given date (this.last.day) iteration stops.

    Parameters

    • Optional isInit: boolean

      When given true will not increment the current day (this.last).

    Returns number

  • Parameters

    • aRuleType: any
    • v: any

    Returns boolean

  • Private

    Checks if given value is in BYSETPOS.

    Parameters

    • aPos: number

      position to check for.

    Returns boolean

    false unless BYSETPOS rules exist and the given value is present in rules.

  • 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

    • options: RecurIteratorData

      The iterator options

    Returns void

  • Parameters

    • inc: number
    • aDateAttr: any
    • aFactor: any
    • aNextIncrement: any

    Returns void

  • Parameters

    • aRuleType: RecurRuleName
    • aInterval: any
    • aDateAttr: any
    • aFollowingAttr: any
    • aPreviousIncr: any

    Returns number

  • Private

    Normalize each by day rule for a given year/month. Takes into account ordering and negative rules

    Parameters

    • year: number

      Current year.

    • month: number

      Current month.

    • rules: number[]

      Array of rules.

    Returns number[]

    sorted and normalized rules. Negative rules will be expanded to their correct positive values for easier processing.

  • Parameters

    • dow: string

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

    • Optional aWeekStart: WeekDay

      The week start weekday

    Returns number[] | readonly [number, number]

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

  • Parameters

    • aRuleType: any
    • req: any
    • deftime: any

    Returns any

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

    Returns any

Generated using TypeDoc