Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

us-holidays

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

us-holidays

Provide utility classes to work with United States holidays.

  • 0.3.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

United States Holidays

Provide utility classes to work with United States holidays.

Currently 11 federal holidays are supported.

Good Friday is also supported.

Martin Luther King Jr. Day started in 1986. However, the stock market only started observing it in 1998. This library uses the 1998 date. Juneteenth started in 2021. However, the stock market only observing it in 2022. This library uses the 2022 date.

Install

yarn add us-holidays

Usage

import { Holidays } from 'us-holidays';

const independenceDay = Holidays.independenceDay;
console.log(independenceDay.getter(2024)); // 2024-07-04
console.log(independenceDay.getter(2023)); // 2023-07-04

for (const holiday of Holidays.all) {
  // all the federal holidays
}
import Year from 'us-holidays/year';

const year = new Year(2024);
console.log(year.christmasDay); // 2024-12-25
console.log(year.independenceDay); // 2024-07-04

FAQs

Package last updated on 27 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc