Package Exports
- cn-workday
- cn-workday/dist/cn-workday.js
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 (cn-workday) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
cn-workday
获取中国工作日情况
Installation
$ npm install cn-workday
Or
$ yarn add cn-workday
Usage
import { isWorkday, getWorkdays } from 'cn-workday';
isWorkday(); // 返回今天是否是工作日
isWorkday('2022-10-08'); // true
isWorkday(new Date('2022-10-08')); // true
getWorkdays(); // 返回本周的工作日数组
getWorkdays('2022-10-08'); // 返回 2022-10-08 所在周的工作日数组
getWorkdays('2022-10-08', 'Month'); // 返回 2022-10-08 所在月份的工作日数组