# OperatingSchedule

Industry: Core

Weekly opening hours in one zone, with dated exceptions.

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

## Members

| Member | Type | Description |
| --- | --- | --- |
| `timeZone` | `string` | The time zone the windows are read in, an IANA name or UTC offset: a time zone identifier (`+05:30`, `+0530`, `-08`) or a stored offset (`±HH:MM[:SS]`, what `getTimeZoneOffset` returns). A UTC offset such as `"+02:00"` observes no DST. |
| `weekly` | `Partial<Record<IsoWeekday, LocalWindow[]>>` ([`IsoWeekday`](/gmt/reference/types/IsoWeekday/), [`LocalWindow`](/gmt/reference/types/LocalWindow/)) | The windows of each ISO weekday. A missing weekday, or `[]`, is closed all day. Windows of one weekday may overlap or touch; they are merged. |
| `holidays?` | `BusinessCalendar` \| `string[]` ([`BusinessCalendar`](/gmt/reference/types/BusinessCalendar/)) | The local dates that are closed, as ISO PlainDate strings. A `BusinessCalendar` can be passed directly: only its `holidays` are read, because `weekly` already says which weekdays open and `timeZone` above is the zone. The calendar must itself pass `isValidBusinessCalendar`, so a bad `weekend` or `timeZone` refuses the schedule. |
| `overrides?` | `OperatingOverride[]` ([`OperatingOverride`](/gmt/reference/types/OperatingOverride/)) | The single dates whose windows replace the weekly ones. An override wins over a holiday on the same date, and two overrides for one date make the schedule invalid. |

## Definition

```ts
type OperatingSchedule = {
  /**
   * The time zone the windows are read in, an IANA name or UTC offset: a time zone identifier
   * (`+05:30`, `+0530`, `-08`) or a stored offset (`±HH:MM[:SS]`, what `getTimeZoneOffset`
   * returns). A UTC offset such as `"+02:00"` observes no DST.
   */
  timeZone: string;
  /**
   * The windows of each ISO weekday. A missing weekday, or `[]`, is closed all day. Windows of
   * one weekday may overlap or touch; they are merged.
   */
  weekly: Partial<Record<IsoWeekday, LocalWindow[]>>;
  /**
   * The local dates that are closed, as ISO PlainDate strings. A `BusinessCalendar` can be passed
   * directly: only its `holidays` are read, because `weekly` already says which weekdays open and
   * `timeZone` above is the zone. The calendar must itself pass `isValidBusinessCalendar`, so a bad
   * `weekend` or `timeZone` refuses the schedule.
   *
   * @defaultValue None. No date is closed as a holiday.
   */
  holidays?: string[] | BusinessCalendar;
  /**
   * The single dates whose windows replace the weekly ones. An override wins over a holiday on the
   * same date, and two overrides for one date make the schedule invalid.
   *
   * @defaultValue None. Every date follows the weekly pattern and the holidays.
   */
  overrides?: OperatingOverride[];
};
```

## Used by

- [`addOperatingTime`](/gmt/reference/calendar/hours/addOperatingTime/)
- [`isOpenAt`](/gmt/reference/calendar/hours/isOpenAt/)
- [`isValidOperatingSchedule`](/gmt/reference/calendar/validate/isValidOperatingSchedule/)
- [`nextCloseAt`](/gmt/reference/calendar/hours/nextCloseAt/)
- [`nextOpenAt`](/gmt/reference/calendar/hours/nextOpenAt/)
- [`operatingIntervals`](/gmt/reference/calendar/hours/operatingIntervals/)
- [`operatingTimeBetween`](/gmt/reference/calendar/hours/operatingTimeBetween/)
- [`recurringWindows`](/gmt/reference/calendar/hours/recurringWindows/)

## Source

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