isBetweenZoned
Signature
Section titled “Signature”isBetweenZoned(zoned: string, start: string, end: string, options?: { inclusiveStart?: boolean; inclusiveEnd?: boolean; }): booleanReturn 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
optional settings for whether each end of the range is included
| Option | Type | Default | Description |
|---|---|---|---|
inclusiveStart? | boolean | true | Whether zoned at the same instant as start counts as inside the range. false requires it to be after start. |
inclusiveEnd? | boolean | true | Whether zoned at the same instant as end counts as inside the range. false requires it to be before end. |
Returns
Section titled “Returns”boolean indicating whether zoned is between start and end
Examples
Section titled “Examples”import { isBetweenZoned } from "@northguild/gmt/zoned/compare";
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]") // true