holiday-calculator
v0.0.1-beta.4
Published
Calculates number of holidays between 2 dates.
Downloads
4
Maintainers
Readme
holiday-calculator
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:
- New Years Day
- Martin Luther King Jr. Day
- Presidents' Day
- Memorial Day
- Independence Day
- Labor Day
- Veterans Day
- Thanksgiving
- Christmas Day
Development
git clone https://github.com/darrinholst/moment-holiday
cd moment-holiday
npm i
npm test
Release
release-it [semver]