feat: add Hong Kong public holiday support
- Add scripts/fetch_hk.py to fetch HK holidays from 1823.gov.hk
- Make generate_ics() cal_name/cal_desc configurable
- Refactor update.py with REGIONS config; support --region cn|hk flag
- Generate hk/{year}.json and hk/{year}.ics under hk/ subdirectory
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -60,11 +60,16 @@ def _iter_date_ranges(days: Sequence[dict]) -> Iterator[Tuple[dict, dict]]:
|
||||
yield fr, to
|
||||
|
||||
|
||||
def generate_ics(days: Sequence[dict], filename: Text) -> None:
|
||||
def generate_ics(
|
||||
days: Sequence[dict],
|
||||
filename: Text,
|
||||
cal_name: str = "中国法定节假日",
|
||||
cal_desc: str = "中国法定节假日数据,自动每日抓取国务院公告。",
|
||||
) -> None:
|
||||
"""Generate ics from days."""
|
||||
cal = Calendar()
|
||||
cal.add("X-WR-CALNAME", "中国法定节假日")
|
||||
cal.add("X-WR-CALDESC", "中国法定节假日数据,自动每日抓取国务院公告。")
|
||||
cal.add("X-WR-CALNAME", cal_name)
|
||||
cal.add("X-WR-CALDESC", cal_desc)
|
||||
cal.add("VERSION", "2.0")
|
||||
cal.add("METHOD", "PUBLISH")
|
||||
cal.add("CLASS", "PUBLIC")
|
||||
|
||||
Reference in New Issue
Block a user