# CalendarOptions

Industry: Core

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`.

```ts
import type { CalendarOptions } from "@northguild/gmt";
```

## Members

| Member | Type | Description |
| --- | --- | --- |
| `reference?` | `string` | 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". |
| `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 `""`. |

## Definition

```ts
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";
}
```

## Used by

- [`formatCalendar`](/gmt/reference/plain/format/formatCalendar/)
- [`formatCalendarUtc`](/gmt/reference/utc/format/formatCalendarUtc/)

## Source

[types/calendar-options.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/types/calendar-options.ts)
