# spacetime-holiday

> reckoning of common holiday dates

Latest version **0.3.0** (published 2022-04-18) · 0 weekly downloads

## Install

```sh
npm install spacetime-holiday
pnpm add spacetime-holiday
yarn add spacetime-holiday
bun add spacetime-holiday
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2022-04-18 |
| First published | 2019-11-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 36.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4107 |
| Author | Spencer Kelly |
| Maintainers | spencermountain |

## Links

- npm: https://www.npmjs.com/package/spacetime-holiday
- Repository: https://github.com/spencermountain/spacetime
- Homepage: https://github.com/spencermountain/spacetime/tree/master/plugins/holiday
- Issues: https://github.com/spencermountain/spacetime/issues
- npm.io page: https://npm.io/package/spacetime-holiday

## Recent versions

- 0.3.0 (latest) — 2022-04-18
- 0.2.2 — 2022-03-08
- 0.2.0 — 2022-01-05
- 0.1.0 — 2020-11-27
- 0.0.2 — 2019-11-15
- 0.0.1 — 2019-11-15

## README

<div align="center">
  <img src="https://cloud.githubusercontent.com/assets/399657/23590290/ede73772-01aa-11e7-8915-181ef21027bc.png" />
  <div>
    <h2>spacetime-holiday</h2>
  </div>
  <div>
    calculate the calendar-date of holidays
  </div>
  <a href="https://npmjs.org/package/spacetime-holiday">
    <img src="https://img.shields.io/npm/v/spacetime-holiday.svg?style=flat-square" />
  </a>
  <a href="https://unpkg.com/spacetime-holiday/builds/spacetime-holiday.min.js">
    <img src="https://badge-size.herokuapp.com/spencermountain/spacetime-holiday/master/builds/spacetime-holiday.min.js" />
  </a>
  <div>
    <sup>
      By <a href="https://github.com/spencermountain">Spencer Kelly</a>
    </sup>
  </div>
</div>

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](https://github.com/spencermountain/spacetime) object.

to conserve filesize of your build, **spacetime** is a peerDependency, so must be installed separately:

`npm i spacetime`

`npm i spacetime-holiday`

```js
const spacetimeHoliday = require('spacetime-holiday')

let s = spacetimeHoliday('easter monday', 2020)
s.format('iso-short')
// 2020-04-12

spacetimeHoliday('groundhog day').format('day') // defaults to next instance
// 'Saturday'

spacetimeHoliday('fall equinox', 2030).format('nice-year')
// 'Sept 22nd, 2030'

// add a timezone
let s = spacetimeHoliday('ramadan', 2019, 'Canada/Pacific')
s.iso()
// 2019-05-05T00:00:00.000-07:00
```

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

- [spacetime-daylight](https://github.com/spencermountain/spacetime-daylight)
- [spacetime-week](https://github.com/spencermountain/spacetime-week)
- [spacetime-informal](https://github.com/spencermountain/spacetime-informal) - timezones like 'pacific time'

MIT

---
_Source: https://npm.io/package/spacetime-holiday · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
