type-alias
Source: dateGranularities.ts ↗
DatePeriodLiteral
One period of a DatePeriodGranularity, in the format of that granularity.
export type DatePeriodLiteral = string;
Remarks
- week: ‘YYYY-WW’, where ‘WW’ is the zero-padded ISO-8601 week number, for example ‘2026-05’ - month: ‘YYYY-MM’, for example ‘2026-03’ - quarter: ‘YYYY-Q’, for example ‘2026-1’ - year: ‘YYYY’, for example ‘2026’
A week literal uses the ISO-8601 week number and the ISO-8601 week-numbering year. Week 53 is valid only in the years that have it. The days of the week depend on the week start: with a Monday start it is the ISO-8601 week from Monday to Sunday, with a Sunday start the same week shifted one day earlier, from Sunday to Saturday.