UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

13 lines • 799 B
import { Temporal } from "../internal/temporal.js"; /** * The anchor a calendar-unit duration operation is measured from, as Temporal's `relativeTo` * option takes it (`Duration.prototype.round`, `Duration.prototype.total`, `Duration.compare`). * * Years, months and weeks have no fixed length, so any operation touching them needs a starting * point; an operation on days and time units alone does not. A string is an ISO 8601 date or * date-time, or a zoned date-time with its time zone annotation. * * A `Z` string, such as `getUtcNow()` returns, is refused and the call returns `null`. To start from * now, pass `getZonedNow("UTC")`. */ export type DurationRelativeTo = Temporal.PlainDateTime | Temporal.ZonedDateTime | Temporal.PlainDateTimeLike | Temporal.ZonedDateTimeLike | string;