PlainDateInterval
const PlainDateInterval: BoundIntervalType<PlainDate>;Defined in: interval-temporal.ts:217
Interval over Temporal.PlainDate (plainDateDomain, discrete, ε 1 day).
Example
Section titled “Example”import { Temporal } from "@js-temporal/polyfill";import { PlainDateInterval } from "@xtandard/lib/temporal";
const d = (s: string) => Temporal.PlainDate.from(s);const week = PlainDateInterval.closed(d("2025-03-01"), d("2025-03-07"));week.length(); // 7 (days)week.union(PlainDateInterval.closed(d("2025-03-08"), d("2025-03-14")))?.toString();// "[2025-03-01,2025-03-14]" (adjacent days merge)