本文へ移動

@eightkk/vue-weave / core / expandRecurrence

Function: expandRecurrence() ​

expandRecurrence(series, range, options?): RecurrenceOccurrence[]

Defined in: src/core/recurrence.ts:615

The occurrences of a recurring series that overlap the half-open range (a zero-duration occurrence when its start is inside it), sorted by start. The first instance (start, end) is always part of the set; the rule adds the later ones, RDATEs add extra starts and EXDATEs remove starts (matched exactly, in epoch milliseconds).

The rule is expanded on local wall-clock times of the series zone: series.timeZone (IANA), else series.utcOffsetMinutes, else options.timeZone, else UTC. Each occurrence starts at the local time of day of the first instance and keeps its local duration, so a weekly 09:00–10:00 meeting stays 09:00–10:00 local time across a daylight-saving change; all-day events (local midnights) keep their number of days. A local time skipped by a daylight-saving gap takes the UTC offset before the gap, and a repeated one its first occurrence (RFC 5545 section 3.3.5). Dates that do not exist, such as February 30 or the 31st of a short month, are skipped and not counted.

Each occurrence has id <series id>:<recurrenceId>, seriesId and recurrenceId, its start before any change. Throws a RangeError when the series produces more than maxOccurrences (default 10,000) instances up to the end of the range, and the Errors of parseRecurrenceRule for an invalid rule. A rule that never matches (such as FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=30) yields only the first instance.

Parameters ​

series ​

RecurrenceSeries

range ​

TimeRange

options? ​

RecurrenceExpandOptions = {}

Returns ​

RecurrenceOccurrence[]

MIT ライセンスで公開しています。