# BusinessCalendar

Industry: Core, Transport, Intermodal

A jurisdiction's working week: which weekdays are weekend, which dates are holidays, and which locality the answer is for.

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

## Members

| Member | Type | Description |
| --- | --- | --- |
| `weekend` | `number[]` | The ISO weekday numbers closed every week, 1 (Monday) through 7 (Sunday). It is explicit because Saturday–Sunday is not universal: much of the Middle East is Friday–Saturday (`[5, 6]`), and some markets keep a one-day weekend (`[7]`). `[]` means no weekly closure, duplicates are ignored, and all seven days leave no business day and are invalid. |
| `holidays` | `string[]` | The dates closed in addition to the weekend, as ISO PlainDate strings (`"2024-07-04"`), never datetimes. Order does not matter and duplicates are ignored. |
| `timeZone` | `string` | The time zone recording which locality the calendar describes, an IANA name or a UTC offset to the minute (what `isValidTimeZone` accepts). It must be a valid zone, but the business-day functions never use it: they take and return local dates, so the answer is the same whatever it says. A caller holding an instant uses it to reduce that instant to a local date first, with `floorToZone` or `getZonedDateTimeFields`. |

## Definition

```ts
type BusinessCalendar = {
  /**
   * The ISO weekday numbers closed every week, 1 (Monday) through 7 (Sunday). It is explicit
   * because Saturday–Sunday is not universal: much of the Middle East is Friday–Saturday
   * (`[5, 6]`), and some markets keep a one-day weekend (`[7]`). `[]` means no weekly closure,
   * duplicates are ignored, and all seven days leave no business day and are invalid.
   */
  weekend: number[];
  /**
   * The dates closed in addition to the weekend, as ISO PlainDate strings (`"2024-07-04"`), never
   * datetimes. Order does not matter and duplicates are ignored.
   */
  holidays: string[];
  /**
   * The time zone recording which locality the calendar describes, an IANA name or a UTC offset to
   * the minute (what `isValidTimeZone` accepts). It must be a valid zone, but the business-day
   * functions never use it: they take and return local dates, so the answer is the same whatever it
   * says. A caller holding an instant uses it to reduce that instant to a local date first, with
   * `floorToZone` or `getZonedDateTimeFields`.
   */
  timeZone: string;
};
```

## Used by

- [`addBusinessDays`](/gmt/reference/plain/calculate/addBusinessDays/)
- [`addOperatingTime`](/gmt/reference/calendar/hours/addOperatingTime/)
- [`buildBusinessCalendar`](/gmt/reference/calendar/rules/buildBusinessCalendar/)
- [`businessDaysBetween`](/gmt/reference/calendar/business/businessDaysBetween/)
- [`chargeableDays`](/gmt/reference/intermodal/calculate/chargeableDays/)
- [`cutoffAt`](/gmt/reference/transport/calculate/cutoffAt/)
- [`cutoffSchedule`](/gmt/reference/transport/calculate/cutoffSchedule/)
- [`freeTimeExpiry`](/gmt/reference/intermodal/calculate/freeTimeExpiry/)
- [`holidayDates`](/gmt/reference/calendar/rules/holidayDates/)
- [`isBusinessDay`](/gmt/reference/plain/compare/isBusinessDay/)
- [`isOpenAt`](/gmt/reference/calendar/hours/isOpenAt/)
- [`isValidBusinessCalendar`](/gmt/reference/calendar/validate/isValidBusinessCalendar/)
- [`isValidOperatingSchedule`](/gmt/reference/calendar/validate/isValidOperatingSchedule/)
- [`mergeCalendars`](/gmt/reference/calendar/business/mergeCalendars/)
- [`nextBusinessDay`](/gmt/reference/calendar/business/nextBusinessDay/)
- [`nextCloseAt`](/gmt/reference/calendar/hours/nextCloseAt/)
- [`nextOpenAt`](/gmt/reference/calendar/hours/nextOpenAt/)
- [`observedDate`](/gmt/reference/calendar/rules/observedDate/)
- [`operatingIntervals`](/gmt/reference/calendar/hours/operatingIntervals/)
- [`operatingTimeBetween`](/gmt/reference/calendar/hours/operatingTimeBetween/)
- [`previousBusinessDay`](/gmt/reference/calendar/business/previousBusinessDay/)
- [`recurringWindows`](/gmt/reference/calendar/hours/recurringWindows/)
- [`rollDate`](/gmt/reference/calendar/business/rollDate/)
- [`subtractBusinessDays`](/gmt/reference/plain/calculate/subtractBusinessDays/)

## Source

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