isPastCutoff
Signature
Section titled “Signature”isPastCutoff(now: string, cutoff: string): booleanReport whether a cut-off has passed.
- The window to meet a cut-off is half-open,
[…, cutoff): at the cut-off instant itself it has closed, sonowequal tocutoffis past. This matches the half-open rule GMT’s intervals follow, andtimeToCutoff, which isPT0Sthere. nowis an exact instant (Z/offset) with no annotation of any kind.cutoffis the zoned stringcutoffAtreturns,<date>T<time>±HH:MM[Zone]: an offset (orZ), then one time zone bracket that agrees with it (the critical[!Zone]too), and nothing after. A bare instant, an offset-less wall time, an offset bracket ([+02:00]) or any other annotation is invalid. They are compared as instants, so the two passes of a repeated hour are told apart by their offsets.nowis the caller’s: GMT does not read the clock here, so the answer is reproducible.- Returns
falseon invalid input, includingcutoffAt’s""sentinel — which reads as “not past”. Check the cut-off is not""before trusting afalse.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
now | string | ISO 8601 instant string of the moment asked about |
cutoff | string | ISO 8601 zoned datetime string of the cut-off, exactly as cutoffAt returns it |
Returns
Section titled “Returns”true when now is at or after the cut-off, false otherwise or on invalid input
Examples
Section titled “Examples”import { isPastCutoff } from "@northguild/gmt/transport/compare";
isPastCutoff("2024-06-12T16:00:00Z", "2024-06-12T17:00:00+02:00[Europe/Amsterdam]") // trueSource
Section titled “Source”Accessibility
© 2026 NorthGuild · Licences
Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.