@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.
23 lines • 909 B
TypeScript
/**
* Core fields shared by all calendar-formatting interfaces.
* Each domain variant (plain, unix, utc, zoned) extends this and may
* add domain-specific fields like `timeZone` or `epochUnit`.
*/
export interface CalendarOptions {
/**
* The moment the day label is measured from, as an ISO string in the same form as the value
* being formatted. A value on the same calendar day reads "today", one on the next day
* "tomorrow".
*
* @defaultValue The current date and time.
*/
reference?: string;
/**
* The length of the time-of-day part, as the `timeStyle` of `Intl.DateTimeFormat`. `"short"`
* writes hours and minutes, `"medium"` adds seconds, `"long"` adds the short time zone name
* ("EDT") and `"full"` the long one ("Eastern Daylight Time"). Any other value returns `""`.
*
* @defaultValue `"short"`
*/
timeStyle?: "short" | "medium" | "long" | "full";
}