isValidDatePeriodLiteral()
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Tells whether the literal is one period in the format of the granularity.
export declare function isValidDatePeriodLiteral(granularity: DatePeriodGranularity | DateRangeParameterGranularity, literal: unknown): boolean;
Parameters
Parameter | Type | Description |
|---|---|---|
granularity | ||
literal | unknown |
Returns
boolean
Remarks
A week is accepted up to the number of ISO-8601 weeks in its year, 52 or 53.
The granularities of a date range parameter are accepted too, in the formats described in IDateRangeParameterPeriod. A day, hour, minute or second must exist in the calendar.