![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@date/holidays-us
Advanced tools
A @date/holidays
instance with USA public and bank holidays.
Also has functions to calculate dates for specific holidays.
npm install @date/holidays-us --save
// get Holidays instance with both public and bank holidays
var holidays = require('@date/holidays-us')
var date = new Date(2016, 0, 1) // New Year's Day 2016
holidays.isHoliday(date) // true
date.setDate(10) // January 10th 2016
holidays.isHoliday(date) // false
date = holidays.thanksgiving(2015) // November 26th, 2015
date = holidays.thanksgiving(2016) // November 24th, 2016
date = holidays.valentinesDay(2016) // February 14th, 2016
holidays.isHoliday(date) // true, it's a holiday
// this will return false because Valentine's Day isn't a bank holiday
holidays.isHoliday(date, {
// only consider it a holiday when the properties in this object match
bank:true // must be a bank holiday
})
// this has only the bank holidays, not the 'public' ones
var holidays = require('@date/holidays-us').bank()
// returns false, Valentine's isn't a bank holiday
holidays.isHoliday(new Date(2016, 1, 14))
// returns true, New Year's is a bank holiday
holidays.isHoliday(new Date(2016, 0, 1))
// this has only the non-bank holidays
var holidays = require('@date/holidays-us').public()
// returns true, Valentine's is a public holiday
holidays.isHoliday(new Date(2016, 1, 14))
// returns false, because New Year's is a bank holiday
holidays.isHoliday(new Date(2016, 0, 1))
// NOTE: technically, I suppose the bank holidays are also
// public holidays, but, if you want both, use the default
// instance which has both
Functions which generate a specific holiday based on a specified year:
Some holidays are "observed" on a different day than the holiday. The generate functions can calculate that as well.
var holidays = require('@date/holidays-us')
// Christmas in 2016 is on a Sunday so it is "observed" the next day, Monday.
// the call to the generator returns the date instance as expected
var christmasDay = holidays.christmas(2016) // same as new Date(2016, 11, 25)
// it also has an `observed` property containing the "observed" holiday date
// Note: if there is no "observed" holiday then `observed` is undefined
var observedChristmas = date.observed
// christmas == new Date(2016, 11, 25) Sunday, December 25th 2016
// observedChristmas == new Date(2016, 11, 26) Monday, December 26th 2016
0.2.0 - 2016/06/30
FAQs
USA bank and (some) public holidays
The npm package @date/holidays-us receives a total of 388 weekly downloads. As such, @date/holidays-us popularity was classified as not popular.
We found that @date/holidays-us demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.