Skip to content

isZonedFuture

isZonedFuture(value: string): boolean
import { isZonedFuture } from "@northguild/gmt/zoned/compare";

Return true when value represents an instant strictly after now.

  • Unlike the plain isFuture, 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 — “future” means strictly after, not on-or-after.
  • Returns false if value is invalid.
Parameter Type Description
value string ISO ZonedDateTime string

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

isZonedFuture("2999-01-01T00:00:00Z[UTC]") // true (an instant in the distant future)
isZonedFuture("2020-01-01T00:00:00Z[UTC]") // false (an instant in the distant past)
isZonedFuture("invalid") // false

zoned/compare/isZonedFuture.ts