Options
All
  • Public
  • Public/Protected
  • All
Menu

A calendar class which supports weekends and an array of arbitrary dates.

The following constructs a holiday calendar for the US in 2020.

import { DateTz, HolidayCalendar } from '@jetblack/date-tz'

const calUS = new HolidayCalendar(
'US',
[0, 6], // Saturday and Sunday are always holidays.
[
new DateTz(2020, 1, 1), // Wed: New Year's Day
new DateTz(2020, 1, 20), // Mon: Martin Luther King Jr. Day
new DateTz(2020, 5, 25), // Mon: Memorial Day
new DateTz(2020, 7, 3), // Fri: Independence Day
new DateTz(2020, 9, 7), // Mon: Labor Day
new DateTz(2020, 11, 11), // Wed: Veterans Day
new DateTz(2020, 11, 26), // Thu: Thanksgiving
new DateTz(2020, 12, 25) // Fri: Christmas Day
]
)

Hierarchy

Index

Constructors

Accessors

Methods

Constructors

Accessors

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

    Returns string

Methods

  • isHoliday(dateTz: DateTz): boolean
  • isWeekend(dateTz: DateTz): boolean

Generated using TypeDoc