formatCalendarZoned
Signature
Section titled “Signature”formatCalendarZoned(value: string, locale?: string, options?: FormatCalendarZonedOptions): stringimport { formatCalendarZoned } from "@northguild/gmt/zoned/format";Format a zoned date-time as a relative day label plus time-of-day, e.g.
- “Tomorrow at 2:30 PM” — the zoned counterpart of
formatCalendar. See that function’s JSDoc for the day-label/threshold/connector design; this variant differs only in readingvalue’s IANA timezone for both the calendar-day comparison and the rendered clock time.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
value |
string |
ZonedDateTime ISO string to format |
locale |
string |
optional: BCP 47 locale tag |
Options
Section titled “Options”options
| Option | Type | Default |
|---|---|---|
reference? |
string | number |
— |
timeStyle? |
"short" | "medium" | "full" |
— |
Returns
Section titled “Returns”the formatted calendar string, or “” on invalid input
Related types
Section titled “Related types”Examples
Section titled “Examples”formatCalendarZoned("2026-03-16T14:30:00-04:00[America/New_York]", "en-US", { reference: "2026-03-15T09:00:00-04:00[America/New_York]" }) // "tomorrow at 2:30 PM"formatCalendarZoned(value, "de-DE") // "morgen um 14:30"formatCalendarZoned("not-a-date") // ""