0.0.1 • Published 4 years ago

holiday-hk v0.0.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
4 years ago

Hong Kong Holiday

  • List of Hong Kong Holiday between 2018-2020.
  • Determine is the day is holiday or not.
  • Show Hong Kong Holiday Information.

npm.io npm.io npm.io npm.io npm.io npm.io

Install

#NPM
npm i holiday-hk --save

Example

const holidayHK = require("holiday-hk");

// Fetch all Hong Kong Holiday list
holidayHK.listAll(); // Return Holiday List [{date: Date, desEn: String, desZH: String, desSc: String}...]

// Determine Is the day is holiday or not
const xmas = new Date("2020-12-25"); // Xams
holidayHK.isHoliday(xmas); // Retrun true

const sunday = new Date("2020-03-15"); // Sunday
holidayHK.isHoliday(sunday); // Retrun false, Because it is Sunday

const workday = new Date("2020-12-28"); // Workday
holidayHK.isHoliday(workday); // Retrun false, Because it is Workday

const xmas = new Date("2020-12-25"); // Xams
holidayHK.getHolidayInfo(xmas); // Return {date: Date, desEn: String, desZH: String, desSc: String}

Method

MethodReturn Type
listAll()Array
isHoliday()Boolean
getHolidayInfo()Object

Properties

PropertyTypeExample
dateDate2020-12-26T00:00:00.000Z
desEnStringChristmas Day
desZhString聖誕節
desScString圣诞节

License

MIT

ChangeLog

End

Free Hong Kong, Revolution now\ Five demands, not one less