465 B
Executable File
465 B
Executable File
ISO Strings and Template Literals
Your code builds interval strings using toISOString() and a template literal.
Example
const interval = `${start.toISOString()}/${end.toISOString()}`;
Why this format is good
- ISO format is unambiguous.
- Easy for backend APIs to parse.
- Includes timezone info (
Zfor UTC).
Example value:
2026-03-23T23:00:00.000Z/2026-03-30T22:00:00.000Z
This describes one weekly period as start/end.