UNPKG

@northguild/gmt

Version:

Date and time library for JavaScript and TypeScript, built on TC39 Temporal: time zones, DST, business days, ISO 8601 strings in and out. Never throws.

19 lines • 868 B
import { IsoWeekday } from "./operating-schedule.js"; /** * Where a holiday that falls on one weekday is observed instead. * * - `"nextWorkingDay"`: the first business day strictly after the holiday. It needs the * `BusinessCalendar` that says which days are open. */ export type ObservanceShift = "nextWorkingDay" | { /** The first weekday strictly after the holiday, 1 to 6 days later; must differ from the holiday's weekday. */ next: IsoWeekday; } | { /** The first weekday strictly before the holiday, 1 to 6 days earlier; must differ from the holiday's weekday. */ previous: IsoWeekday; }; /** * Per ISO weekday of the holiday (1 Monday to 7 Sunday), the shift to apply. A weekday with no * entry is not shifted, and `{}` shifts nothing. There is no default policy. */ export type ObservancePolicy = Partial<Record<IsoWeekday, ObservanceShift>>;