All Projects → DakerHub → cn-holiday

DakerHub / cn-holiday

Licence: MIT License
a lib for chinese holiday

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cn-holiday

HolidayApi
节假日api
Stars: ✭ 48 (+118.18%)
Mutual labels:  holiday
pbrtbook
pbrt 中文整合翻译 基于物理的渲染:从理论到实现 Physically Based Rendering: From Theory To Implementation
Stars: ✭ 221 (+904.55%)
Mutual labels:  chinese
fishing-funds
基金,大盘,股票,虚拟货币状态栏显示小应用,基于Electron开发,支持MacOS,Windows,Linux客户端,数据源来自天天基金,蚂蚁基金,爱基金,腾讯证券,新浪基金等
Stars: ✭ 424 (+1827.27%)
Mutual labels:  chinese
R-Markdown-Template
R Markdown Templates For Chinese Users
Stars: ✭ 21 (-4.55%)
Mutual labels:  chinese
neural network papers
记录一些读过的论文,给出个人对论文的评分情况并简述论文insight
Stars: ✭ 152 (+590.91%)
Mutual labels:  chinese
kaldi-timit-sre-ivector
Develop speaker recognition model based on i-vector using TIMIT database
Stars: ✭ 17 (-22.73%)
Mutual labels:  chinese
kula
Lightweight and highly extensible .NET scripting language.
Stars: ✭ 43 (+95.45%)
Mutual labels:  chinese
holidata
Holidata is the core of holidata.net, a no-nonsense, ad-free provider of international holiday data.
Stars: ✭ 27 (+22.73%)
Mutual labels:  holiday
Functional-Light-JS-Zh
《Functional-Light-JS》中文翻译
Stars: ✭ 14 (-36.36%)
Mutual labels:  chinese
ChineseFonts
Convert asian text to web fonts
Stars: ✭ 14 (-36.36%)
Mutual labels:  chinese
seqgan
用seqgan训练生成小黄鸡语料
Stars: ✭ 33 (+50%)
Mutual labels:  chinese
wasm-cn
[翻译中] WebAssembly 中文文档
Stars: ✭ 22 (+0%)
Mutual labels:  chinese
LightLM
高性能小模型测评 Shared Tasks in NLPCC 2020. Task 1 - Light Pre-Training Chinese Language Model for NLP Task
Stars: ✭ 54 (+145.45%)
Mutual labels:  chinese
LEDs-single-gpu-passthrough
Single GPU passthrough guide 单显卡直通教程资源
Stars: ✭ 87 (+295.45%)
Mutual labels:  chinese
hzk-pixel-font
中文像素字体,12 和 16 像素。
Stars: ✭ 14 (-36.36%)
Mutual labels:  chinese
CLUEmotionAnalysis2020
CLUE Emotion Analysis Dataset 细粒度情感分析数据集
Stars: ✭ 3 (-86.36%)
Mutual labels:  chinese
tudien
Từ điển tiếng Việt dành cho Kindle
Stars: ✭ 38 (+72.73%)
Mutual labels:  chinese
WMPoetry
The source codes of Working Memory model for Chinese poetry generation (IJCAI 2018).
Stars: ✭ 49 (+122.73%)
Mutual labels:  chinese
Workday.WebServices
Workday API clients
Stars: ✭ 18 (-18.18%)
Mutual labels:  workday
alfred-chinese-converter
支持 OpenCC 簡繁體中文詞彙級別轉換、異體字轉換以及地區習慣用詞轉換的 Alfred 2 workflow
Stars: ✭ 42 (+90.91%)
Mutual labels:  chinese

CN-HOLIDAY

cn-holiday.js是一个基于国务院发布的每年的节假日的一个日期库,包含了对节假日(三倍工资),休息日(双倍工资)和工作日(包括国家规定调休)的查询api。

目前支持2011-2018年的节假日查询

Installation

NPM:

$ npm install cn-holiday --save

Getting Started

import ch from 'cn-holiday'

ch.isHoliday('2018-10-1')

API

isHoliday

判断一个日期是否为法定节假日

  • date string|timestamp|Date 日期
  • 返回:boolean
ch.isHoliday('2018-5-1')
// true

isWorkday

判断一个日期是否为工作日(包括法定调休)

  • date string|timestamp|Date 日期
  • 返回:boolean
ch.isWorkday('2018-4-28')
// true

isRestday

判断一个日期是否为法定休息日(除开正常双休)

  • date string|timestamp|Date 日期
  • 返回:boolean
ch.isRestday('2018-4-30')
// true

getHolidaysBetween

获取两个日期之间的所有法定节假日

  • date1 string|timestamp|Date 日期1
  • date2 string|timestamp|Date 日期2
  • 返回:Array
ch.getHolidaysBetween('2018-10-1', '2018-10-3')
// ['2018-10-01', '2018-10-02', '2018-10-03']

getWorkdaysBetween

获取两个日期之间的所有工作日

  • date1 string|timestamp|Date 日期1
  • date2 string|timestamp|Date 日期2
  • 返回:Array
ch.getWorkdaysBetween('2018-9-28', '2018-10-8')
// ['2018-09-28', '2018-09-29', '2018-09-30', '2018-10-08']

getWorkdaysCountBetween

获取两个日期之间的所有工作日数量

  • date1 string|timestamp|Date 日期1
  • date2 string|timestamp|Date 日期2
  • 返回:Number
ch.getWorkdaysBetween('2018-9-28', '2018-10-8')
// 4

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].