0.0.1-beta.3 • Published 7 years ago

not-a-moment-holiday-plugin v0.0.1-beta.3

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

not-a-moment-holiday-plugin

npm-version Build Status dependencies dev dependencies peer dependencies

Holiday utilities for Moment. Not a plugin though. 😒

Installation

node

npm install not-a-moment-holiday-plugin

API

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

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

import {US} from 'not-a-moment-holiday-plugin';

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. Memorial Day
  3. Independence Day
  4. Labor Day
  5. Thanksgiving
  6. Christmas Day

Development

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

Release

release-it [semver]