chinese-calendar
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

chinese-calendar-js

判断一天是不是法定节假日/法定工作日(查看节假日安排)。

使用方法

安装

  • npm
  npm i chinese-calendar
  • yarn
  yarn add chinese-calendar

使用

  • 浏览器下(基于 webpack 构建)
  import calendar from 'chinese-calendar'
  calendar.isHoliday('2020-10-08') // true
  calendar.getHolidayDetail('2020-10-07') // ['National Day', '国庆节', 3]
  • NodeJS 下
  const calendar = require('chinese-calendar)
  calendar.isHoliday('2020-10-08') // true
  calendar.getHolidayDetail('2020-10-07') // ['National Day', '国庆节', 3]

其他语言版本

后续更新

  • [ ] 【chore】使用 GitHub Actions 直接构建
  • [ ] 【feat】提供判断某天是否为法定工作日的功能
  • [ ] 【feat】提供判断某天是否为调休的功能(本来应该是周一到周五的某一天,结果调休了)
  • [ ] 【feat】把20年之前的历史数据加进来
  • [ ] 【feat】支持直接传 Date 对象
  • [ ] 【feat】提供 cli 支持

Readme

Keywords

Package Sidebar

Install

npm i chinese-calendar

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

11.9 kB

Total Files

16

Last publish

Collaborators

  • huangzilong