spacetime-holiday
calculate the calendar-date of holidays
Some holidays are the same day every year, some holidays change astronomically, some by calendar rules like 'third thursday in June'.
This library tries its best to reconcile them.
if it finds a date, it returns a spacetime object.
to conserve filesize of your build, spacetime is a peerDependency, so must be installed separately:
npm i spacetime
npm i spacetime-holiday
const spacetimeHoliday = require('spacetime-holiday')
let s = spacetimeHoliday('easter monday', 2020)
s.format('iso-short')
spacetimeHoliday('groundhog day').format('day')
spacetimeHoliday('fall equinox', 2030).format('nice-year')
let s = spacetimeHoliday('ramadan', 2019, 'Canada/Pacific')
s.iso()
work-in-progress!
-
american/western holidays 👍
-
Easter-based christian holidays 👍
-
Astronomical holidays 👍
-
Muslim holidays (predicted) 😞
-
Jewish-calendar holidays (not implemented) 😞
-
Chinese-calendar holidays (not implemented) 😞
See also
MIT