Examples

API Snippets

Small, focused demos for public helpers that do not need a full scenario page. This page covers resolving a window from an existing Temporal.ZonedDateTime and checking whether two exact instants land in the same operational window.

Guided Tour

Use this page after the scenario demos when you only need the smaller helper entry points.

Start with Operational Day Demo, continue with DST Critical Cases, or return to the Examples Tour.

getWindowForZonedDateTime

Use this when your application already has a zoned timestamp and you want the library to resolve the surrounding operational window.

Strategy
Input zoned timestamp
Resolved window start
Resolved window end
Window ID
What to notice
const zdt = Temporal.ZonedDateTime.from(
  '2026-10-24T12:00:00+01:00[Europe/London]'
);

const window = getWindowForZonedDateTime(zdt, strategy);

isSameWindow

Use this when you need to compare two exact instants and ask whether they belong to the same boundary-defined operational window.

Strategy
Scenario
Instant A
Instant B
A resolves to
B resolves to
Result
What to notice
const same = isSameWindow(instantA, instantB, strategy);