1.3.0 • Published 4 years ago

nz-public-holidays v1.3.0

Weekly downloads
61
License
-
Repository
github
Last release
4 years ago

Produces dates and details for New Zealand public holidays. Uses this government .iCal as source. If this changes, please raise an issue.

Install

npm install nz-public-holidays

Usage

const holidays = require('nz-public-holidays');

holidays((error, holidays) => {
    if (error) return console.error(error);
    console.log(...holidays.map((holiday) => {
      const { date, name, region, category, observedByWeekendWorker } = holiday;
      return `UPDATE tablename SET [HolidayName] = '${category}'` +
        `, [IsHoliday] = 1 WHERE [Date] = '${date}'`;
    }));
});

// OR

(async () => {
  const holidays = await holidays();
  console.log(...holidays.map((holiday) => {
      const { date, name, region, category, observedByWeekendWorker } = holiday;
      return `UPDATE tablename SET [HolidayName] = '${category}'` +
        `, [IsHoliday] = 1 WHERE [Date] = '${date}'`;
  }));
})();

Response Schema

Column nameTypeDescription
datestringDate of holiday YYYY-MM-DD
namestringRaw name of holiday
regionstringName of applicable region
categorystringStandardised name of holiday
observedByWeekendWorkerbooleanIf holiday is observed exclusively by weekend workers

Regions

Northland, Auckland, Taranaki, Hawke's Bay, Wellington, Marlborough, Nelson, Buller, South Canterbury, Canterbury, Westland, Otago, Southland, Chatham Islands, All

Categories

New Year's Day, Day after New Year's Day, Waitangi Day, Good Friday, Easter Monday, ANZAC Day, Queen's Birthday, Labour Day, Christmas Day, Boxing Day, Anniversary (Region)

Author

Tomas van der Wel

License

Copyright © 2019 Tomas van der Wel. This project is MIT licensed.

1.3.0

4 years ago

1.2.0

4 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago