Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WeekendCalendar

A calendar where specific days of the week are considered holidays.

Hierarchy

Index

Constructors

Accessors

Methods

Constructors

  • Construct a weekend calendar.

    Parameters

    • name: string = 'WeekendCalendar'

      An optional calendar name.

    • weekends: number[] = ...

      An optional array of week days. Defaults to [0, 6] for Saturday and Sunday.

    Returns WeekendCalendar

Accessors

  • get name(): string
  • Get the calendar name.

    Returns string

Methods

  • isHoliday(date: Date, tz?: Timezone): boolean
  • Check if the date is a holiday.

    Parameters

    • date: Date

      The date to check.

    • tz: Timezone = tzLocal

      An optional timezone. Defaults to the local timezone.

    Returns boolean

    True if the date is a holiday, otherwise false.

  • isWeekend(date: Date, tz?: Timezone): boolean
  • Check if the date is a weekend.

    Parameters

    • date: Date

      The date.

    • tz: Timezone = tzLocal

      An optional timezone. Defaults to the local timezone.

    Returns boolean

    True is the date is a weekend, otherwise false.

Generated using TypeDoc