holiday-calculator
TypeScript icon, indicating that this package has built-in type declarations

0.0.1-beta.4 • Public • Published

holiday-calculator

npm-version Build Status dependencies dev dependencies peer dependencies

Holiday utilities for Moment. Not a plugin though. 😒

Installation

node

npm install holiday-calculator

API

countBusinessHolidaysBetween(startDate: Moment | string, endDate: Moment | string)

Returns the number of holidays observed by businesses between startDate and endDate.

import {US} from 'holiday-calculator';
 
new US().countBusinessHolidaysBetween('2017-01-01', '2017-12-31'); // => 6

Holiday Rules

All the rules for determining holidays is encapsulated in a Holidays object. US is currently the only one that's builtin. It recognizes:

  1. New Years Day
  2. Martin Luther King Jr. Day
  3. Presidents' Day
  4. Memorial Day
  5. Independence Day
  6. Labor Day
  7. Veterans Day
  8. Thanksgiving
  9. Christmas Day

Development

git clone https://github.com/darrinholst/moment-holiday
cd moment-holiday
npm i
npm test

Release

release-it [semver]

Package Sidebar

Install

npm i holiday-calculator

Weekly Downloads

37

Version

0.0.1-beta.4

License

MIT

Last publish

Collaborators

  • darrinholst