Skip to content

CalendarOptions

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.

import type { CalendarOptions } from "@northguild/gmt";
MemberTypeDescription
reference?stringThe 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”.
timeStyle?"long" | "short" | "medium" | "full"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 "".
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";
}

types/calendar-options.ts