isBetweenZoned
Signature
Section titled “Signature”isBetweenZoned(zoned: string, start: string, end: string, options?: { inclusiveStart?: boolean; inclusiveEnd?: boolean; }): booleanimport { isBetweenZoned } from "@northguild/gmt/zoned/compare";Return true when zoned is between start and end (inclusive by default).
- Validates inputs and then compares using Temporal.Instant (same instant semantics).
- Returns false for invalid inputs.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
zoned |
string |
ISO ZonedDateTime string to check |
start |
string |
ISO ZonedDateTime string for the start of the range |
end |
string |
ISO ZonedDateTime string for the end of the range |
Options
Section titled “Options”options
| Option | Type | Default |
|---|---|---|
inclusiveStart? |
boolean |
— |
inclusiveEnd? |
boolean |
— |
Returns
Section titled “Returns”boolean indicating whether zoned is between start and end
Examples
Section titled “Examples”isBetweenZoned("2024-02-29T12:00:00+00:00[UTC]", "2024-02-29T11:00:00+00:00[UTC]", "2024-02-29T13:00:00+00:00[UTC]") // trueisBetweenZoned("invalid", "2024-02-29T11:00:00+00:00[UTC]", "2024-02-29T13:00:00+00:00[UTC]") // false