Go to file
北门清燕 38a1d46900
feat: add X-WR-CALNAME,X-WR-CALDESC to icalendar (#133)
增加订阅日历名称、描述

Co-authored-by: NateScarlet <NateScarlet@Gmail.com>
2021-11-04 11:34:32 +08:00
.github/workflows ci: run linter 2021-10-10 02:22:34 +08:00
tests style: use black as formatter 2021-09-22 19:22:48 +08:00
.coveragerc Correct coveragerc 2019-03-12 23:07:53 +08:00
.gitignore Update .gitignore 2019-03-08 00:19:43 +08:00
2007.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2007.json feat: add json schema 2019-09-11 22:42:42 +08:00
2008.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2008.json feat: add json schema 2019-09-11 22:42:42 +08:00
2009.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2009.json feat: add json schema 2019-09-11 22:42:42 +08:00
2010.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2010.json feat: add json schema 2019-09-11 22:42:42 +08:00
2011.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2011.json feat: add json schema 2019-09-11 22:42:42 +08:00
2012.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2012.json feat: add json schema 2019-09-11 22:42:42 +08:00
2013.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2013.json feat: add json schema 2019-09-11 22:42:42 +08:00
2014.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2014.json feat: add json schema 2019-09-11 22:42:42 +08:00
2015.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2015.json Update holiday data [skip ci] 2021-09-22 19:33:26 +08:00
2016.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2016.json feat: add json schema 2019-09-11 22:42:42 +08:00
2017.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2017.json feat: add json schema 2019-09-11 22:42:42 +08:00
2018.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2018.json feat: add json schema 2019-09-11 22:42:42 +08:00
2019.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2019.json Update holiday data [skip ci] 2021-09-22 19:33:26 +08:00
2020.ics feat: add ics output (#128) 2021-10-10 02:02:56 +08:00
2020.json Update holiday data [skip ci] 2020-09-07 14:35:29 +00:00
2021.ics Update holiday data [skip ci] 2021-10-09 19:01:40 +00:00
2021.json revert: "Update holiday data [skip ci]" 2021-09-24 20:15:18 +08:00
2022.ics Update holiday data [skip ci] 2021-10-25 16:28:23 +00:00
2022.json Update holiday data [skip ci] 2021-10-25 16:28:23 +00:00
dev-requirements.txt chore(deps): update dependency coverage to v6.1.1 2021-10-31 16:10:31 +00:00
fetch_holidays.py chore: change error message 2021-09-24 20:35:22 +08:00
generate_ics.py feat: add X-WR-CALNAME,X-WR-CALDESC to icalendar (#133) 2021-11-04 11:34:32 +08:00
holiday-cn.ics Update holiday data [skip ci] 2021-10-25 16:28:23 +00:00
LICENSE Initial commit 2019-03-05 10:56:09 +08:00
Makefile ci: run linter 2021-10-10 02:22:34 +08:00
README.md docs: add icalendar subscription 2021-10-10 02:36:32 +08:00
renovate.json chore: modify renovate.json 2019-04-28 20:49:31 +08:00
requirements.txt chore(deps): update dependency icalendar to v4.0.9 2021-10-19 03:48:03 +00:00
schema.json chore: update json schema 2019-09-11 23:00:55 +08:00
update.py fix: ics file change not trigger release 2021-10-10 02:59:32 +08:00

holiday-cn

Build Status Release CalVer Maintainability Test Coverage Maintenance

中国法定节假日数据 自动每日抓取国务院公告

  • 提供 JSON 格式节假日数据
  • CI 自动更新
  • 数据变化时自动发布新版本 ( Watch - Release only 以获取邮件提醒! )
  • 发布页面提供 JSON 打包下载

数据格式:

JSON Schema

interface Holidays {
  /** 完整年份, 整数。*/
  year: number;
  /** 所用国务院文件网址列表 */
  papers: string[];
  days: {
    /** 节日名称 */
    name: string;
    /** 日期, ISO 8601 格式 */
    date: string;
    /** 是否为休息日 */
    isOffDay: boolean;
  }[]
}

注意事项

  • 年份是按照国务院文件标题年份而不是日期年份12 月份的日期可能会被下一年的文件影响,因此应检查两个文件。

通过互联网使用

数据地址格式:

https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/{年份}.json

访问 github 不方便时可使用国内镜像仓库

https://natescarlet.coding.net/p/github/d/holiday-cn/git/raw/master/{年份}.json

或使用 JSDelivr

https://cdn.jsdelivr.net/gh/NateScarlet/holiday-cn@master/{年份}.json

ICalendar 订阅

网址格式参见上一节

{年份}.ics 为对应年份的节假日

holiday-cn.ics 为 3 年前至次年的节假日

感谢 @retanoj 的 ics 格式转换实现

作为 git 子模块使用

参见 Git 工具 - 子模块