ISO date range union
iso-date-range-union · version 1.0.0 · Dates & times (UTC, ISO 8601) · free, no key needed
Merge overlapping or day-adjacent inclusive [start, end] date ranges into the fewest equivalent ranges.
Use when you need to: iso date range union · merge date ranges · combine overlapping date periods.
Supported
- iso date range union
- merge date ranges
- combine overlapping date periods
Not supported
- open ranges
- timezones
- datetime ranges
Behavior
- ranges is an array of 1-1000 inclusive [start, end] YYYY-MM-DD date ranges with year 0001-9999; start must not be after end in any entry.
- Two ranges merge when they overlap or are day-adjacent (one starts the calendar day immediately after the other ends).
- union is the sorted, non-overlapping, non-adjacent set of merged ranges covering exactly the same days as the input, ascending by start.
Input
ranges(array of object, required): min items 1; max items 1000
Output
union(array of object, required)
Limits
- year min: 1
- year max: 9999
- max ranges: 1000
Example
Request input:
{
"ranges": [
{
"start": "2026-01-01",
"end": "2026-01-05"
},
{
"start": "2026-01-06",
"end": "2026-01-10"
},
{
"start": "2026-02-01",
"end": "2026-02-05"
}
]
}
Response:
{
"result": {
"union": [
{
"start": "2026-01-01",
"end": "2026-01-10"
},
{
"start": "2026-02-01",
"end": "2026-02-05"
}
]
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "iso-date-range-union",
"version": "1.0.0",
"input": {
"ranges": [
{
"start": "2026-01-01",
"end": "2026-01-05"
},
{
"start": "2026-01-06",
"end": "2026-01-10"
},
{
"start": "2026-02-01",
"end": "2026-02-05"
}
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/iso-date-range-union/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"ranges":[{"start":"2026-01-01","end":"2026-01-05"},{"start":"2026-01-06","end":"2026-01-10"},{"start":"2026-02-01","end":"2026-02-05"}]}'
The machine-readable contract is at /v1/tools/iso-date-range-union/versions/1.0.0.
CLI
node cli.mjs run iso-date-range-union 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- ISO date range intersect: Compute the intersection of two inclusive [start, end] date ranges.
- ISO date range overlap: Test whether two inclusive [start, end] date ranges share at least one day.
- ISO date range split by month: Split an inclusive [start, end] date range into per-calendar-month sub-ranges.
- ISO date clamp: Clamp a YYYY-MM-DD calendar date into an inclusive [min, max] range.
- ISO date range contains: Test whether an inclusive [start, end] date range contains a given date.
- ISO date range list: Enumerate the dates in an inclusive [start, end] range stepped by a whole number of days.