compareDatePeriodLiterals()
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Compares two valid period literals of the same granularity.
export declare function compareDatePeriodLiterals(granularity: DatePeriodGranularity | DateRangeParameterGranularity, a: DatePeriodLiteral, b: DatePeriodLiteral): number;
Parameters
Parameter | Type | Description |
|---|---|---|
granularity | ||
a | ||
b |
Returns
number
a negative number when ‘a’ is earlier than ‘b’, zero when they are the same period and a positive number when ‘a’ is later than ‘b’