Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including holiday-lk with all npm packages installed. Try it out:

var holidayLk = require("holiday-lk")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

holiday-lk v1.0.5

Holidays in Sri Lanka, NodeJs porting of Ruby holiday_jp

holiday-lk

Holidays in Sri Lanka holiday-lk

Installation

npm install holiday-lk

Usage

var holiday = require('holiday-lk')

// find holidays between 2019-01-10 ~ 2019-01-20
// returns Array of Object (see below for their properties)
holiday.between(new Date("2019-01-10"), new Date("2019-01-20"))

// whether given date is holiday or not
// return true (or false)
holiday.isHoliday(new Date("2019-02-25"))

Properties

  • dayName: String - day of the week (ex. "Sunday")
  • date: Date - Date object of the holiday (ex. 2019-02-04T00:00:00.000Z)
  • name: String - name of the holiday (ex. "National Day")

License

MIT

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free