Socket
Socket
Sign inDemoInstall

@quartz/holidays

Package Overview
Dependencies
1
Maintainers
8
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.0 to 1.2.0

23

index.js
const { allForYear } = require( '@18f/us-federal-holidays' );
// Sometimes we get the day off.
const oneOffHolidays = {
2020: [
{
name: 'Monday after Indepedence Day',
date: new Date( '2020-07-06' ),
dateString: '2020-7-6',
},
],
};
function getHolidays( year ) {

@@ -20,6 +31,14 @@ // Expect a reasonable year. This code will die.

// Remove Veterans Day and Columbus Day.
const removeUnobserved = ( { name } ) => ! [ 'veterans', 'columbus' ].includes( name.toLowerCase() );
return [
// Remove Veterans Day.
...fedHolidays.filter( ( { name } ) => ! name.toLowerCase().includes( 'veteran' ) ),
...fedHolidays.filter( removeUnobserved ),
...( oneOffHolidays[ year ] || [] ),
{
name: 'Juneteenth',
date: new Date( `${year}-06-19` ),
dateString: `${year}-6-19`,
},
{
name: 'Day after Thanksgiving',

@@ -26,0 +45,0 @@ date: blackFriday,

2

package.json
{
"name": "@quartz/holidays",
"version": "1.1.0",
"version": "1.2.0",
"description": "Quartz holidays",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -28,2 +28,3 @@ const test = require( 'tape' );

t.ok( isHoliday( new Date( '2019-01-01' ) ), 'New Year\'s 2019' );
t.ok( isHoliday( new Date( '2023-06-19' ) ), 'Juneteenth 2023' );
t.ok( isHoliday( new Date( '2019-12-08' ), { weekends: true } ), 'a random Sunday' );

@@ -30,0 +31,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc