datetime/humanize_recurrence_utils library
Human-readable text for a simple recurrence rule — roadmap #599.
Turns a RecurrenceSpec (frequency + interval + optional day/week/month fields) into a short English phrase such as "every 2 weeks on Tuesday" or "every 2nd Tuesday of the month", for display next to a schedule.
The output is fixed library English, NOT app-facing i18n copy: these strings
describe the data model itself, so plain English literals belong here and are
not routed through any translation catalog. Weekday/month numbering follows
the DateTime convention (1 = Monday .. 7 = Sunday; month 1 = January).
Classes
- RecurrenceSpec
-
An immutable description of a simple recurrence. Only the fields relevant to
frequency are read by humanizeRecurrence; the others may stay
null.
Enums
- RecurrenceFrequency
- How often a recurrence repeats; the unit the RecurrenceSpec.interval multiplies.
Functions
-
humanizeRecurrence(
RecurrenceSpec spec) → String -
A short English phrase describing
spec, e.g. "every 2 weeks on Tuesday".