Skip to content

DurationRelativeTo

DurationRelativeTo is a structural type that appears in public signatures. It is not directly importable.

The anchor date a calendar-unit duration operation resolves against, as accepted by Temporal’s relativeTo option (Duration.prototype.round/.total, Duration.compare). Years/months/weeks have no fixed length, so any operation touching them needs a starting point; day/time-only operations do not.

type DurationRelativeTo =
| Temporal.PlainDateTime
| Temporal.ZonedDateTime
| Temporal.PlainDateTimeLike
| Temporal.ZonedDateTimeLike
| string;

types/duration-relative-to.ts