intervalContains
Signature
Section titled “Signature”intervalContains(interval: Interval, isoString: string): booleanReturn true when an ISO 8601 instant string lies inside a half-open interval.
start ≤ t < end:startis inside,endis not.- Always
falsefor an empty interval (start === end) — it contains no instant. - Compares instants:
isoStringmay be written with a different offset from either endpoint. - The positional
intervalContainsUtc,intervalContainsZoned(…) follow the same half-open rule and excludeend. - Returns
falseon invalid input —intervalnot anInterval, orisoStringnot an instant string (offset required, no leap second, no annotation of any kind, such as[Europe/Paris]or[u-ca=hebrew]).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
interval | Interval | { start, end } record of ISO 8601 instant strings |
isoString | string | ISO 8601 instant string to test |
Returns
Section titled “Returns”true if the instant is inside the interval, or false on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”import { intervalContains } from "@northguild/gmt/interval/compare";
intervalContains({ start: "2024-01-01T09:00:00Z", end: "2024-01-01T17:00:00Z" }, "2024-01-01T09:00:00Z") // true — start is insideSource
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.