isBetweenUtc
Signature
Section titled “Signature”isBetweenUtc(value: string, start: string, end: string, options?: { inclusiveStart?: boolean; inclusiveEnd?: boolean; }): booleanReturn true when value is between start and end (inclusive by default).
- Uses Temporal.Instant.compare for comparison.
- Returns false if start > end or inputs are invalid.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value | string | ISO UTC datetime string to check |
start | string | ISO UTC datetime string for range start |
end | string | ISO UTC datetime string for range end |
Options
Section titled “Options”options
Whether each boundary counts as inside the range
| Option | Type | Default | Description |
|---|---|---|---|
inclusiveStart? | boolean | true | Whether value equal to start counts as inside the range. false requires it to be after start. |
inclusiveEnd? | boolean | true | Whether value equal to end counts as inside the range. false requires it to be before end. |
Returns
Section titled “Returns”boolean indicating whether value is between start and end
Examples
Section titled “Examples”import { isBetweenUtc } from "@northguild/gmt/utc/calculate";
isBetweenUtc("2024-03-15T12:00:00Z", "2024-03-10T12:00:00Z", "2024-03-20T12:00:00Z") // true