determine whether the date is a public holiday in China.
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 it (https://github.com/kang8/chinese-holidays)
- Create your feature branch (
git checkout -b new_feature
) - Commit your changes (
git commit -am 'New feature'
) - Push to the branch (
git push origin new_feature
) - Create a new Pull Request
Distributed under the MIT License. See LICENSE for more information.