feature/hk-holiday-support #2

Merged
mingsheng.li merged 3 commits from feature/hk-holiday-support into master 2026-04-27 05:14:46 +00:00
Showing only changes of commit 72ab05df3f - Show all commits

View File

@@ -6,14 +6,17 @@
[![JSDelivr](https://data.jsdelivr.com/v1/package/gh/NateScarlet/holiday-cn/badge?style=rounded)](https://www.jsdelivr.com/package/gh/NateScarlet/holiday-cn) [![JSDelivr](https://data.jsdelivr.com/v1/package/gh/NateScarlet/holiday-cn/badge?style=rounded)](https://www.jsdelivr.com/package/gh/NateScarlet/holiday-cn)
![Maintenance](https://img.shields.io/maintenance/yes/2024.svg) ![Maintenance](https://img.shields.io/maintenance/yes/2024.svg)
中国法定节假日数据 自动每日抓取国务院公告 中国大陆及香港节假日数据
- 中国大陆:自动每日抓取国务院公告
- 香港:来源于香港特别行政区政府 [1823.gov.hk](https://www.1823.gov.hk/common/ical/tc.json),数据覆盖 2024 年起
- [x] 提供 JSON 格式节假日数据 - [x] 提供 JSON 格式节假日数据
- [x] CI 自动更新 - [x] CI 自动更新
- [x] 数据变化时自动发布新版本 ( `Watch` - `Release only` 以获取邮件提醒! ) - [x] 数据变化时自动发布新版本 ( `Watch` - `Release only` 以获取邮件提醒! )
- [x] [发布页面]提供 JSON 打包下载 - [x] [发布页面]提供 JSON 打包下载
数据格式: 数据格式(中国大陆、香港通用):
[JSON Schema](./schema.json) [JSON Schema](./schema.json)
@@ -21,7 +24,7 @@
interface Holidays { interface Holidays {
/** 完整年份, 整数。*/ /** 完整年份, 整数。*/
year: number; year: number;
/** 所用国务院文件网址列表 */ /** 所用数据来源网址列表 */
papers: string[]; papers: string[];
days: { days: {
/** 节日名称 */ /** 节日名称 */
@@ -36,15 +39,23 @@ interface Holidays {
## 注意事项 ## 注意事项
**中国大陆**
- 年份是按照国务院文件标题年份而不是日期年份12 月份的日期可能会被下一年的文件影响,因此应检查两个文件。 - 年份是按照国务院文件标题年份而不是日期年份12 月份的日期可能会被下一年的文件影响,因此应检查两个文件。
- `与周末连休` 的周末不是法定节假日,数据里不会包含,见[《全国年节及纪念日放假办法》](https://www.gov.cn/zhengce/content/202411/content_6986380.htm) [#213](https://github.com/NateScarlet/holiday-cn/issues/213#issuecomment-1869546011) [#221](https://github.com/NateScarlet/holiday-cn/issues/221) - `与周末连休` 的周末不是法定节假日,数据里不会包含,见[《全国年节及纪念日放假办法》](https://www.gov.cn/zhengce/content/202411/content_6986380.htm) [#213](https://github.com/NateScarlet/holiday-cn/issues/213#issuecomment-1869546011) [#221](https://github.com/NateScarlet/holiday-cn/issues/221)
**香港**
- 香港不设调休补班制度,数据中不会出现 `isOffDay: false` 的条目。
- 假期名称为繁体中文。
- 数据覆盖范围取决于港府发布进度,通常提前公布至次年。
## 通过互联网使用 ## 通过互联网使用
提示:任何第三方服务都可能故障或停止服务,如果稳定性要求高请自己搭建静态文件服务。 提示:任何第三方服务都可能故障或停止服务,如果稳定性要求高请自己搭建静态文件服务。
数据地址格式: ### 中国大陆
`https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/{年份}.json` `https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/{年份}.json`
@@ -62,14 +73,24 @@ interface Holidays {
~~`https://natescarlet.coding.net/p/github/d/holiday-cn/git/raw/master/{年份}.json`~~ ~~`https://natescarlet.coding.net/p/github/d/holiday-cn/git/raw/master/{年份}.json`~~
### 香港
`https://raw.githubusercontent.com/NateScarlet/holiday-cn/master/hk/{年份}.json`
## ICalendar 订阅 ## ICalendar 订阅
网址格式参见上一节 ### 中国大陆
`{年份}.ics` 为对应年份的节假日 `{年份}.ics` 为对应年份的节假日
`holiday-cn.ics` 为 3 年前至次年的节假日 `holiday-cn.ics` 为 3 年前至次年的节假日
### 香港
`hk/{年份}.ics` 为对应年份的节假日
`holiday-hk.ics` 为 3 年前至次年的节假日
感谢 @retanoj 的 ics 格式转换实现 感谢 @retanoj 的 ics 格式转换实现
## 作为 git 子模块使用 ## 作为 git 子模块使用