parseRRule

Calendar
stable

Parse a raw RFC 5545 RRULE string into a normalised `IParsedRule` object, or return `null` when the directive is malformed or uses an unsupported `FREQ` value. Supports `DAILY`, `WEEKLY`, and `MONTHLY` frequencies.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

rrule
required
string
A raw RRULE string with or without the `RRULE:` prefix (e.g. `"RRULE:FREQ=WEEKLY;BYDAY=MO,WE;COUNT=10"` or `"FREQ=MONTHLY;INTERVAL=2"`). Semicolon-separated key=value pairs are parsed case-insensitively.

API

Return value

The value returned by this util.

A normalised `{ freq, interval, count, until, byDay }` object on success, or `null` when the input is empty, malformed, or uses an unsupported frequency. Callers should fall back to single-occurrence rendering on `null`.

Usage

Examples

Ready-to-paste usage snippets.

Parse a weekly recurrence rule

typescript