Skip to content

isZonedPast

isZonedPast(value: string): boolean

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.
ParameterTypeDescription
valuestringISO ZonedDateTime string

true if value is before the current instant, false on invalid input

import { isZonedPast } from "@northguild/gmt/zoned/compare";
isZonedPast("2020-01-01T00:00:00Z[UTC]") // true (an instant in the distant past)
output 

zoned/compare/isZonedPast.ts