UNPKG

@burglekitt/gmt

Version:

Temporal-based date and time utilities with timezone support and polyfill integration

19 lines (18 loc) 883 B
/** * Return true when `value` represents an instant strictly before now. * * - Unlike the plain `isPast`, which compares calendar days, this compares * the exact instant `value` represents against `Temporal.Now.instant()` — * `value` carries 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 `value` is invalid. * * @param value ISO ZonedDateTime string * @returns true if `value` is before the current instant, false on invalid input * * @example isZonedPast("2020-01-01T00:00:00Z[UTC]") // true (an instant in the distant past) * @example isZonedPast("2999-01-01T00:00:00Z[UTC]") // false (an instant in the distant future) * @example isZonedPast("invalid") // false */ export declare function isZonedPast(value: string): boolean;