China Holiday Calendar Sync
Use only official gov.cn holiday notices as the source of truth for China holiday and adjusted-workday schedules.
Keep the workflow conservative:
- - Prefer configured
notice_urls first. - Use China government policy search for discovery before any public-search fallback.
- Parse official notice正文 into structured holiday/workday rows.
- Treat future-year discovery as low-frequency work, not a daily poll.
Workflow
- 1. Load configured notice URLs.
- Reuse known official notice URLs from local config first.
- For already-synced years, prefer local calendar storage instead of refetching the notice page.
- 2. Discover missing future-year notices carefully.
- Build exact queries around
国务院办公厅关于<year>年部分节假日安排的通知.
- Prefer China government policy search.
- Accept only
https://www.gov.cn/zhengce/content/... candidate pages.
- Re-fetch the candidate and validate title/body before trusting it.
- 3. Throttle discovery.
- For future years, probe at most once per month.
- Default probe window starts on the 15th of the month.
- Cache both positive and negative discovery results for that month.
- 4. Parse official notice content.
- Extract holiday ranges such as
1月1日至3日.
- Extract adjusted workdays such as
1月4日(周日)上班.
- Emit normalized rows with
date,
is_holiday,
is_workday,
holiday_name, and
source_url.
- 5. Persist two layers separately.
- Stable source mapping in
notice_urls
- Probe history in INLINECODE12
Rules
- - Do not use third-party holiday calendars as authoritative data.
- Do not fabricate future-year schedules before an official notice exists.
- If a future year has not been published yet, return no URL and cache that negative check for the month.
- If a year is already present in local holiday storage, do not refetch the official notice unless the caller explicitly wants a refresh.
References
Output Shape
Normalize notice parsing results into a shape close to:
CODEBLOCK0
中国节假日日历同步
仅使用官方gov.cn节假日通知作为中国节假日和调休工作日程的权威数据源。
保持工作流程的保守性:
- - 优先使用已配置的notice_urls。
- 在回退到公共搜索之前,优先使用中国政府政策搜索进行发现。
- 将官方通知正文解析为结构化的节假日/工作日数据行。
- 将未来年份的发现视为低频工作,而非每日轮询。
工作流程
- 1. 加载已配置的通知URL。
- 首先复用本地配置中已知的官方通知URL。
- 对于已同步的年份,优先使用本地日历存储,而非重新获取通知页面。
- 2. 谨慎发现缺失的未来年份通知。
- 围绕国务院办公厅关于
年部分节假日安排的通知构建精确查询。
- 优先使用中国政府政策搜索。
- 仅接受https://www.gov.cn/zhengce/content/...格式的候选页面。
- 在信任之前,重新获取候选页面并验证标题和正文。
- 3. 限制发现频率。
- 对于未来年份,每月最多探测一次。
- 默认探测窗口从每月15日开始。
- 缓存当月的正向和负向发现结果。
- 4. 解析官方通知内容。
- 提取节假日范围,例如1月1日至3日。
- 提取调休工作日,例如1月4日(周日)上班。
- 输出标准化数据行,包含date、isholiday、isworkday、holidayname和sourceurl。
- 5. 分别持久化两个层级。
- 在notice_urls中存储稳定的源映射。
- 在discovery_cache中存储探测历史。
规则
- - 不得将第三方节假日日历作为权威数据使用。
- 在官方通知发布之前,不得虚构未来年份的日程安排。
- 如果未来年份尚未发布,则不返回URL,并将该月份的负向检查结果缓存。
- 如果某年份已存在于本地节假日存储中,则除非调用方明确要求刷新,否则不重新获取官方通知。
参考资料
输出格式
将通知解析结果规范化为接近以下格式:
json
{
date: 2026-10-08,
is_holiday: false,
is_workday: true,
holiday_name: 国庆节调休上班,
sourceurl: https://www.gov.cn/zhengce/content/202511/content7047090.htm
}