isZonedPast
Signature
Section titled “Signature”isZonedPast(value: string): booleanimport { isZonedPast } from "@northguild/gmt/zoned/compare";Return true when value represents an instant strictly before now.
- Unlike the plain
isPast, which compares calendar days, this compares the exact instantvaluerepresents againstTemporal.Now.instant()—valuecarries a full time-of-day, not just a date. value === now(to the precision available) returns false — “past” means strictly before, not on-or-before.- Returns false if
valueis invalid.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ISO ZonedDateTime string |
Returns
Section titled “Returns”true if value is before the current instant, false on invalid input
Examples
Section titled “Examples”isZonedPast("2020-01-01T00:00:00Z[UTC]") // true (an instant in the distant past)isZonedPast("2999-01-01T00:00:00Z[UTC]") // false (an instant in the distant future)isZonedPast("invalid") // false