JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 67
  • Score
    100M100P100Q98620F
  • License MIT

Chinese holidays

Package Exports

  • chinese-holidays

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (chinese-holidays) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

chinese-holidays

提供具有中国特色的休假安排或者工作日查询。

Install

npm install chinese-holidays

Usage

var ChineseHolidays = require('chinese-holidays');

元旦 = new Date(2016, 0, 1)
// 是否休假(含正常的周六、周日)
ChineseHolidays.isHoliday(元旦)     
// true

// 是否是工作日(含节假日的调休)
ChineseHolidays.isWorkingday(元旦)
// fase


// 列出已知的特殊节假日
ChineseHolidays.all().forEach(function(holiday){
  console.log(holiday.name)
  console.log(holiday.days().map(function(date) { return moment(date).format('YYYY-MM-DD') }))
})
// 元旦
// ["2016-01-01", "2016-01-02", "2016-01-03"]
// ...

Support

References

License

The package is available as open source under the terms of the MIT License.