Skip to content

formatCalendarZoned

formatCalendarZoned(value: string, locale?: string, options?: FormatCalendarZonedOptions): string
import { 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 reading value’s IANA timezone for both the calendar-day comparison and the rendered clock time.
Parameter Type Description
value string ZonedDateTime ISO string to format
locale string optional: BCP 47 locale tag

options

Option Type Default
reference? string | number
timeStyle? "short" | "medium" | "full"

the formatted calendar string, or “” on invalid input

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") // ""

zoned/format/formatCalendarZoned.ts