Socket
Socket
Sign inDemoInstall

@springworks/holidays

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @springworks/holidays

Utils to manage public holidays.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
3.53 MB
Created
Weekly downloads
 

Readme

Source

node-holidays

Build Status Coverage Status

A node module for managing local public holidays.

Example 1:

var holidays = require('node-holidays')('sv-SE');

if(holidays.isHoliday('2014-12-25')) {
  // The 25th of December is a holiday.
}

Example 2:

var Holidays = require('node-holidays'),
    holidays = Holidays('sv-SE');

if(holidays.isHoliday('2014-12-25')) {
  // The 25th of December is a holiday.
}

Example 3:

var Holidays = require('node-holidays'),
    holidays = Holidays('sv-SE');

holidays.setLocale('en-US'); // Set the locale to en-US.
if(holidays.isHoliday('2014-12-25')) {
  // The 25th of December is a holiday.
}

API

getLocale()

Returns the current locale.

var holidays = require('node-holidays')('en-US');
assert(holidays.getLocale() === 'en-US');

setLocale(locale)

Sets the current locale for the module.

var holidays = require('node-holidays')('en-US');
assert(holidays.getLocale() === 'en-US');
holidays.setLocale('sv-SE');
assert(holidays.getLocale() === 'sv-SE');

isHoliday(date)

Checks if a given date is a holiday.

var is_holiday = holidays.isHoliday('2014-12-25');
assert(is_holiday === true);

getHolidays(year)

Gets an array of all holidays for a given year.

var 2014_holidays = holidays.getHolidays(2014);
assert(2014_holidays.indexOf('2014-12-25') > -1);

Extending

Look at /lib/l10n/_template.js for an example.

sv-SE

FAQs

Last updated on 30 Sep 2015

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.

Install

Related posts

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