isPast
Signature
Section titled “Signature”isPast(value: string): booleanimport { isPast } from "@northguild/gmt/plain/compare";Return true when value is strictly before today, per the system clock
- and system timeZone.
value === todayreturns false — “past” means strictly before, not on-or-before.- Compares against
getToday(), so this depends on the system clock and system timeZone. A caller needing determinism should useisZonedPastwith an explicit timeZone, or compare against an explicit reference withisBeforeDate. - Returns false if
valueis invalid or the system timeZone is unavailable.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO PlainDate string |
Returns
Section titled “Returns”true if value is before today, false on invalid input
Examples
Section titled “Examples”isPast("2024-03-14") // true, if today is 2024-03-15isPast("2024-03-15") // false, if today is 2024-03-15 (equal is not past)isPast("2024-03-16") // false, if today is 2024-03-15isPast("invalid") // false