判断日期是否为中国法定节假日
English | 中文
npm install @kang8/chinese-holidays
import { holiday } from '@kang8/chinese-holidays'
const national_day = new Date('2022-10-01')
holiday.isHoliday(national_day) // true
holiday.isWorkday(national_day) // false
holiday.isPublicHoliday(national_day) // true
holiday.isPublicWorkday(national_day) // false
holiday.publicHolidayName(national_day) // 国庆节
holiday.publicHolidayName(new Date('2022-09-30')) // null
npm install
npm run build
npm test
- Fork 仓库 (https://github.com/kang8/chinese-holidays)
- 创建分支 (
git checkout -b new_feature
) - 提交你的修改 (
git commit -am 'New feature'
) - 推送你的分支 (
git push origin new_feature
) - 发送 Pull Request
根据 MIT 许可证分发。更多信息请参见 LICENSE。