@northguild/gmt
Version:
Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.
10 lines • 442 B
TypeScript
/**
* How a date compares with today in the host's time zone.
*
* @param value an ISO `PlainDate` string
* @returns `-1` before today, `0` today, `1` after today, or `null` for an invalid date or when the host reports no time zone or clock
*
* @example compareToToday("2024-03-14") // -1, if today is 2024-03-15
* @example compareToToday("invalid") // null
*/
export declare function compareToToday(value: unknown): -1 | 0 | 1 | null;