The DateHelper used by the time-period operations (val/start/end/next/prev) and by
nextDate/prevDate while enumerating occurrences. Defaults to the static (local-time) DateHelper. Set to
a timezone-aware DateHelperTZ (by CalendarCacheSingle) for the duration of a generation pass so recurring
calendar intervals are computed directly in the intended timezone, with correct DST handling. Always restored in
a finally, so the shared periods stay timezone agnostic and the compiled-schedule caches remain valid.
Cached compile function. Lazily created by createCompiler.
Compile a parsed schedule definition into an executable schedule object. The returned
CompiledSchedule provides next, prev, nextRange, prevRange, and isValid
methods for enumerating occurrences.
Compiled schedule with enumeration methods
Compile a single schedule constraint into a resolution engine.
Constraint mapping period keys to allowed values
Period objects from createTimePeriods
Modifier functions from createModifiers
Engine with start, end, tick, tickSafe, tickStart methods
Normalize a matched token's text into the value the schedule builder expects.
Raw matched text (already lowercased)
Which TEXT_TOKENTYPES regex matched
Converted token value
Build a CompiledSchedule from a parsed ScheduleDefinition.
Parsed schedule definition
Compile function from createCompiler
Create (or retrieve from cache) the compile function. The compile function transforms a single ScheduleConstraint into a resolution engine.
A function that compiles a ScheduleConstraint into a CompiledConstraint
Create modifier functions (after/before) used by the schedule compiler.
Modifiers wrap a TimePeriod constraint to restrict it to a subset of its extent.
Map of modifier functions keyed by name (after, before) and short alias (a, b)
Internal factory hook for the text parser to obtain a fresh ScheduleBuilder. External callers should use recur instead.
Build the TimePeriodMap, a long-name/short-alias view over the TimePeriodsMixin singletons.
Map of period objects keyed by name and alias (e.g. both year and Y map to the periodYear static)
after N modifier which restricts constraint to values >= N.
Period to restrict
[N] — threshold value
Restricted period
before N modifier which restricts constraint to values < N.
Period to restrict
[N] — threshold value (last entry used)
Restricted period
Build a Date for the start of a period. Uses 1-based month. Omitted fields default to the start of the period (Jan 1, 00:00:00).
Full year
Roll forward to the next period if the current value is past or equal to value.
Current date
Target constraint value
The constraint being resolved
The containing period to roll over
Parse a human-readable text expression into a schedule definition. Recognized expressions include patterns like
"every 5 minutes", "on Monday, Wednesday, and Friday at 9:00", "on the 1st and 15th day of the month", etc.
If parsing fails, the returned definition will have error >= 0 indicating the character position where parsing stopped.
Human-readable schedule expression
Parsed definition with schedules, exceptions, and error fields
Build a Date for the end of a period. Uses 1-based month. Omitted fields default to the end of the period (Dec 31, 23:59:59).
Full year
Roll backward to the previous period if the current value is at or past value.
Current date
Target constraint value
The constraint being resolved
The containing period to roll over
Create a fluent recurrence builder for composing schedule definitions programmatically.
Chain constraint methods (.on(), .every(), .after(), .before()) followed by
a time-period method (.second(), .minute(), .hour(), .dayOfMonth(),
.dayOfWeek(), .month(), .year(), etc.) to build up a definition.
The returned builder can be passed directly as a recurrentStartDate or recurrentEndDate
value on calendar intervals, or compiled via compile.
Fluent builder with .schedules and .exceptions arrays
Lowercase month/weekday/ordinal → numeric value. Used by the text parser.
Token regexes for the human-readable text parser.
day (alias D) time period, day of month (1-31).
dayOfWeek (aliases dw, d) time period, ISO-ish day of week (1=Sun … 7=Sat).
dayOfWeekCount (alias dc) time period, 1-based n-th instance of the current weekday in the current
month (e.g. the 2nd Tuesday). A value of 0 denotes "last occurrence".
dayOfYear (alias dy) time period, 1-based day of year (1-366).
fullDate (alias fd) time period. Used for anchoring rules like after 2022-01-01 to a specific date.
hour (alias h) time period — hour of day (0-23).
minute (alias m) time period — minute of hour (0-59).
month (alias M) time period — 1-based month of year (1-12).
second (alias s) time period — second of minute (0-59).
time (alias t) time period — seconds since midnight (0-86399). Used by rules like at 10:00.
weekOfMonth (alias wm) time period — 1-based week-of-month (week starts Sunday). Used for rules like on the 2nd week of the month.
weekOfYear (alias wy) time period. Week 1 is the week containing the first Thursday of the year.
year (alias Y) time period, calendar year 1970-2099.
Generated using TypeDoc
Calendar interval parser which compiles recurrence definitions into executable schedule objects. Provides parsing of human-readable text expressions and a fluent builder API for defining recurring schedules. Compiled schedules can enumerate forward and backward occurrences, check validity, compute ranges, and drive timers.