isValidZonedInterval
Signature
Section titled “Signature”isValidZonedInterval(start: string, end: string): booleanReturn true if start and end form a valid zoned interval — both valid ISO ZonedDateTime strings (isValidZonedDateTime) and the instant at start is <= the instant at end.
- Both inputs must be valid ISO 8601 zoned datetime strings.
- Equal
start === endis valid. - Comparison is done by instant, so intervals spanning DST transitions are compared by absolute time.
- Reads each endpoint as
isValidZonedDateTimedoes: the zone bracket is the only annotation, and a calendar ([u-ca=iso8601],[u-ca=hebrew]) or an elective one ([foo=bar]) returnsfalse.isValidCalendarZonedIntervalreads the calendar. - Invalid input, malformed strings, or leap-second strings return
false.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
start | string | ISO ZonedDateTime string (interval start) |
end | string | ISO ZonedDateTime string (interval end) |
Returns
Section titled “Returns”true if start and end form a valid zoned interval, or false on invalid input
Examples
Section titled “Examples”import { isValidZonedInterval } from "@northguild/gmt/zoned/interval";
isValidZonedInterval("2024-01-01T10:00:00+00:00[UTC]", "2024-12-31T23:59:59+00:00[UTC]") // 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.