mapZonedDatesInRange
Signature
Section titled “Signature”mapZonedDatesInRange(startZonedDateTime: string, endZonedDateTime: string, stepDays?: number): string[]import { mapZonedDatesInRange } from "@northguild/gmt/zoned/map";Return an array of plain ISO date strings covering the inclusive date range between two zoned datetimes.
- Both datetimes must have the same timezone.
- Returns [] for invalid inputs, mismatched timezones, start > end, or invalid step.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
startZonedDateTime |
string |
start zoned ISO 8601 datetime string |
endZonedDateTime |
string |
end zoned ISO 8601 datetime string |
stepDays |
`` | optional positive integer step in days |
Returns
Section titled “Returns”array of ISO date strings or [] when invalid
Examples
Section titled “Examples”mapZonedDatesInRange("2024-02-28T12:00:00+00:00[UTC]", "2024-03-02T12:00:00+00:00[UTC]") // ["2024-02-28", "2024-02-29", "2024-03-01", "2024-03-02"]mapZonedDatesInRange("2024-02-28T12:00:00+00:00[UTC]", "2024-03-02T12:00:00+00:00[UTC]", 2) // ["2024-02-28", "2024-03-01"]mapZonedDatesInRange("invalid", "2024-03-02T12:00:00+00:00[UTC]") // []