expandRecurrence

Calendar
stable

Expands a single calendar event with an optional RRULE string into all occurrences that fall within a given date range. Supports a minimal RFC 5545 subset (FREQ=DAILY|WEEKLY|MONTHLY, INTERVAL, COUNT, UNTIL, BYDAY). Non-recurring events are returned as-is when they overlap the range.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

Only FREQ=DAILY|WEEKLY|MONTHLY, INTERVAL, COUNT, UNTIL, and BYDAY are supported. Other RFC 5545 directives (BYMONTHDAY, EXDATE, …) are silently ignored.

API

Paramètres

Paramètres d'entrée acceptés par cet util.

event
requis
IEvent
The calendar event to expand. If it has an rrule string, occurrences are generated; otherwise it is returned as-is (filtered against the range).
range
requis
{ start: Date, end: Date }
The visible date window. Only occurrences that overlap this range are included in the result.

API

Valeur de retour

La valeur retournée par cet util.

An array of event copies (one per occurrence) that fall within the range. Empty array when no occurrences match.

Usage

Exemples

Extraits de code prêts à coller.

Weekly recurrence over a month

typescript