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

rwa-holidays

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rwa-holidays

NPM package for getting Rwanda holidays for a given year or determine if current date is a holiday

  • 1.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

rwa-holidays

Build Status Npm Weekly Downloads npm Open Source Love Open Source Love

NPM package for getting Rwanda holidays for a given year or determine if current date is a holiday, it also shifts holidays when actual holiday happens in weekend

Installation

npm install rwa-holidays
yarn add rwa-holidays

Usage

To get a list of all Rwanda holidays in a given year, use the getHolidays method. If no year is passed in, it uses the current year.

const { getHolidays } = require('rwa-holidays');

const holidays = getHolidays(2020);


// Results
[
  {
    name: 'Genocide against the Tutsi Memorial Day',
    date: 2020-04-07T00:00:00.000Z,
    dateString: '2020-4-7'
  },
  {
    name: 'Liberation Day',
    date: 2020-07-03T00:00:00.000Z,
    dateString: '2020-7-3'
  },
  {
    name: 'National Heroes Day',
    date: 2020-01-31T00:00:00.000Z,
    dateString: '2020-1-31'
  },
  {
    name: "New Year's Day",
    date: 2020-01-01T00:00:00.000Z,
    dateString: '2020-1-1'
  },
  {
    name: 'Day after New Year’ s Day',
    date: 2020-01-02T00:00:00.000Z,
    dateString: '2020-1-2'
  },
  {
    name: 'Labor Day',
    date: 2020-05-01T00:00:00.000Z,
    dateString: '2020-5-1'
  },
  {
    name: 'Independence Day',
    date: 2020-07-01T00:00:00.000Z,
    dateString: '2020-7-1'
  },
  {
    name: 'Assumption Day',
    date: 2020-08-14T00:00:00.000Z,
    dateString: '2020-8-14'
  },
  {
    name: 'Christmas Day',
    date: 2020-12-25T00:00:00.000Z,
    dateString: '2020-12-25'
  },
  {
    name: 'Boxing Day',
    date: 2020-12-25T00:00:00.000Z,
    dateString: '2020-12-25'
  },
  {
    name: 'Umuganura Day',
    date: 2020-08-07T00:00:00.000Z,
    dateString: '2020-8-7'
  }
]

Find if a date is a holiday, use the isAHoliday method. If no argument is provided, defaults to the current date:

const { isAHoliday } = require("rwa-holidays");

const options = {
  utc: false
};
const isAHoliday = isAHoliday(my_date, options);
// Returns true or false

For holidays that fall on Saturdays holidays are shifted to Friday:

const { isAHoliday } = require("rwa-holidays");
console.log(isHoliday(new Date("2010-12-25"))); // False
console.log(isHoliday(new Date("2010-12-24"))); // True

For holidays that fall on Sundays holidays are shifted to Monday:

const { isAHoliday } = require("rwa-holidays");
console.log(isHoliday(new Date("2005-12-25"))); // False
console.log(isHoliday(new Date("2005-12-26"))); // True

Contribution

License

MIT

Author

Igwaneza Bruce

Keywords

FAQs

Package last updated on 22 Feb 2020

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