@qingwu-ui/holiday-data 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data.json +4062 -1
- package/dist/index.cjs +4032 -3
- package/dist/index.d.cts +7 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4032 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/schema.json +27 -0
- package/years/2001.json +151 -0
- package/years/2002.json +175 -0
- package/years/2003.json +117 -0
- package/years/2004.json +155 -0
- package/years/2005.json +165 -0
- package/years/2006.json +170 -0
- package/years/2007.json +175 -0
- package/years/2008.json +190 -0
- package/years/2009.json +180 -0
- package/years/2010.json +200 -0
- package/years/2011.json +185 -0
- package/years/2012.json +185 -0
- package/years/2013.json +220 -0
- package/years/2014.json +150 -0
- package/years/2015.json +176 -0
- package/years/2016.json +165 -0
- package/years/2017.json +160 -0
- package/years/2018.json +160 -0
- package/years/2019.json +176 -0
- package/years/2020.json +206 -0
- package/years/2021.json +205 -0
- package/years/2022.json +205 -0
- package/years/2023.json +185 -0
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["data"],"sources":["../data.json","../src/schema.ts","../src/index.ts"],"sourcesContent":["","/** 数据协议独立于运行时与农历算法;calendar/core 构建时内联本文件。 */\nexport interface DataSource {\n title: string;\n publisher: string;\n url: string;\n accessedAt: string;\n}\n\nexport interface HolidayDay {\n date: string;\n name: string;\n isOffDay: boolean;\n}\n\nexport interface HolidayYear {\n schemaVersion: 1;\n year: number;\n updatedAt: string;\n sources: DataSource[];\n days: HolidayDay[];\n}\n\nexport interface SourcedText {\n text: string;\n sources: DataSource[];\n}\n\nexport interface FestivalRecord {\n id: string;\n name: string;\n rule: {\n calendar: \"lunar\" | \"solar\" | \"solar-term\" | \"lunar-eve\";\n month?: number;\n day?: number;\n term?: string;\n };\n description: SourcedText;\n origin: SourcedText;\n customs: SourcedText;\n}\n\nexport interface HolidayData {\n schemaVersion: 1;\n updatedAt: string;\n years: HolidayYear[];\n festivals: FestivalRecord[];\n}\n\nexport function isISODate(value: unknown): value is string {\n if (typeof value !== \"string\" || !/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return false;\n const date = new Date(`${value}T00:00:00Z`);\n return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === value;\n}\n\nfunction object(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction source(value: unknown): boolean {\n if (\n !object(value) ||\n typeof value.title !== \"string\" ||\n typeof value.publisher !== \"string\" ||\n !isISODate(value.accessedAt) ||\n typeof value.url !== \"string\"\n )\n return false;\n try {\n return [\"https:\", \"http:\"].includes(new URL(value.url).protocol);\n } catch {\n return false;\n }\n}\n\nfunction sources(value: unknown): boolean {\n return Array.isArray(value) && value.every(source);\n}\n\nfunction sourcedText(value: unknown): boolean {\n return (\n object(value) &&\n typeof value.text === \"string\" &&\n sources(value.sources) &&\n Array.isArray(value.sources) &&\n value.sources.length > 0\n );\n}\n\nexport function validateHolidayYear(value: unknown): asserts value is HolidayYear {\n if (\n !object(value) ||\n value.schemaVersion !== 1 ||\n !Number.isInteger(value.year) ||\n !isISODate(value.updatedAt) ||\n !sources(value.sources) ||\n !Array.isArray(value.days)\n ) {\n throw new TypeError(\"年度节假日 JSON 格式不正确\");\n }\n const dates = new Set<string>();\n for (const day of value.days) {\n if (\n !object(day) ||\n !isISODate(day.date) ||\n typeof day.name !== \"string\" ||\n typeof day.isOffDay !== \"boolean\" ||\n Math.abs(Number(day.date.slice(0, 4)) - Number(value.year)) > 1 ||\n dates.has(day.date)\n ) {\n throw new TypeError(\"节假日日期无效、重复或放假/补班冲突\");\n }\n dates.add(day.date);\n }\n}\n\nexport function validateHolidayData(value: unknown): asserts value is HolidayData {\n if (\n !object(value) ||\n value.schemaVersion !== 1 ||\n !isISODate(value.updatedAt) ||\n !Array.isArray(value.years) ||\n !Array.isArray(value.festivals)\n )\n throw new TypeError(\"节假日 JSON 格式不正确\");\n const years = new Set<number>();\n for (const year of value.years) {\n validateHolidayYear(year);\n if (years.has(year.year)) throw new TypeError(\"节假日年份重复\");\n years.add(year.year);\n }\n const ids = new Set<string>();\n for (const festival of value.festivals) {\n if (\n !object(festival) ||\n typeof festival.id !== \"string\" ||\n ids.has(festival.id) ||\n typeof festival.name !== \"string\" ||\n !object(festival.rule) ||\n !sourcedText(festival.description) ||\n !sourcedText(festival.origin) ||\n !sourcedText(festival.customs)\n ) {\n throw new TypeError(\"节日资料必须包含介绍、渊源、习俗及各自来源\");\n }\n const rule = festival.rule;\n if (rule.calendar === \"lunar\" || rule.calendar === \"solar\") {\n const maxDay = rule.calendar === \"lunar\" ? 30 : 31;\n if (\n !Number.isInteger(rule.month) ||\n Number(rule.month) < 1 ||\n Number(rule.month) > 12 ||\n !Number.isInteger(rule.day) ||\n Number(rule.day) < 1 ||\n Number(rule.day) > maxDay\n )\n throw new TypeError(\"节日日期规则无效\");\n } else if (rule.calendar === \"solar-term\") {\n if (typeof rule.term !== \"string\" || !rule.term) throw new TypeError(\"节气规则无效\");\n } else if (rule.calendar !== \"lunar-eve\") throw new TypeError(\"未知节日日期规则\");\n ids.add(festival.id);\n }\n}\n\n/** 接受 JSON.parse 后的对象,也接受年度文件;年度输入不会替换其他年份。 */\nexport function parseHolidayData(value: unknown): HolidayData {\n if (object(value) && \"year\" in value) {\n validateHolidayYear(value);\n return { schemaVersion: 1, updatedAt: value.updatedAt, years: [value], festivals: [] };\n }\n validateHolidayData(value);\n return value;\n}\n\nexport function mergeHolidayData(\n base: HolidayData,\n custom: HolidayData | HolidayYear,\n): HolidayData {\n const input = parseHolidayData(custom);\n const years = new Map(base.years.map((year) => [year.year, year]));\n const festivals = new Map(base.festivals.map((festival) => [festival.id, festival]));\n for (const year of input.years) years.set(year.year, year);\n for (const festival of input.festivals) festivals.set(festival.id, festival);\n return {\n schemaVersion: 1,\n updatedAt: input.updatedAt,\n years: [...years.values()].sort((a, b) => a.year - b.year),\n festivals: [...festivals.values()],\n };\n}\n","import data from \"../data.json\";\nimport { parseHolidayData } from \"./schema\";\n\nexport * from \"./schema\";\nexport const holidayData = parseHolidayData(data);\nexport function getHolidayYear(year: number) {\n return holidayData.years.find((item) => item.year === year) ?? null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACvF;CACA,oBAAoB,KAAK;CACzB,OAAO;AACT;AAEA,SAAgB,iBACd,MACA,QACa;CACb,MAAM,QAAQ,iBAAiB,MAAM;CACrC,MAAM,QAAQ,IAAI,IAAI,KAAK,MAAM,KAAK,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC;CACjE,MAAM,YAAY,IAAI,IAAI,KAAK,UAAU,KAAK,aAAa,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC;CACnF,KAAK,MAAM,QAAQ,MAAM,OAAO,MAAM,IAAI,KAAK,MAAM,IAAI;CACzD,KAAK,MAAM,YAAY,MAAM,WAAW,UAAU,IAAI,SAAS,IAAI,QAAQ;CAC3E,OAAO;EACL,eAAe;EACf,WAAW,MAAM;EACjB,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,EAAE,IAAI;EACzD,WAAW,CAAC,GAAG,UAAU,OAAO,CAAC;CACnC;AACF;;;ACxLA,MAAa,cAAc,iBAAiBA,YAAI;AAChD,SAAgB,eAAe,MAAc;CAC3C,OAAO,YAAY,MAAM,MAAM,SAAS,KAAK,SAAS,IAAI,KAAK;AACjE"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["data"],"sources":["../data.json","../src/schema.ts","../src/index.ts"],"sourcesContent":["","/** 数据协议独立于运行时与农历算法;calendar/core 构建时内联本文件。 */\nexport interface DataSource {\n title: string;\n publisher: string;\n url: string;\n accessedAt: string;\n}\n\nexport interface HolidayDay {\n date: string;\n name: string;\n isOffDay: boolean;\n}\n\nexport interface HolidayYear {\n schemaVersion: 1;\n year: number;\n updatedAt: string;\n sources: DataSource[];\n days: HolidayDay[];\n /** 非空时表示仅部分收录;未列出的日期不能据此认定为工作日。 */\n missingHolidays?: string[];\n}\n\nexport interface SourcedText {\n text: string;\n sources: DataSource[];\n}\n\nexport interface FestivalRecord {\n id: string;\n name: string;\n rule: {\n calendar: \"lunar\" | \"solar\" | \"solar-term\" | \"lunar-eve\";\n month?: number;\n day?: number;\n term?: string;\n };\n description: SourcedText;\n origin: SourcedText;\n customs: SourcedText;\n}\n\nexport interface HolidayData {\n schemaVersion: 1;\n updatedAt: string;\n years: HolidayYear[];\n festivals: FestivalRecord[];\n coverage?: { startYear: number; endYear: number; missingYears: number[] };\n}\n\nexport function isISODate(value: unknown): value is string {\n if (typeof value !== \"string\" || !/^\\d{4}-\\d{2}-\\d{2}$/.test(value)) return false;\n const date = new Date(`${value}T00:00:00Z`);\n return Number.isFinite(date.getTime()) && date.toISOString().slice(0, 10) === value;\n}\n\nfunction object(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction source(value: unknown): boolean {\n if (\n !object(value) ||\n typeof value.title !== \"string\" ||\n typeof value.publisher !== \"string\" ||\n !isISODate(value.accessedAt) ||\n typeof value.url !== \"string\"\n )\n return false;\n try {\n return [\"https:\", \"http:\"].includes(new URL(value.url).protocol);\n } catch {\n return false;\n }\n}\n\nfunction sources(value: unknown): boolean {\n return Array.isArray(value) && value.every(source);\n}\n\nfunction sourcedText(value: unknown): boolean {\n return (\n object(value) &&\n typeof value.text === \"string\" &&\n sources(value.sources) &&\n Array.isArray(value.sources) &&\n value.sources.length > 0\n );\n}\n\nexport function validateHolidayYear(value: unknown): asserts value is HolidayYear {\n if (\n !object(value) ||\n value.schemaVersion !== 1 ||\n !Number.isInteger(value.year) ||\n Number(value.year) < 1000 ||\n Number(value.year) > 9999 ||\n !isISODate(value.updatedAt) ||\n !sources(value.sources) ||\n !Array.isArray(value.days)\n ) {\n throw new TypeError(\"年度节假日 JSON 格式不正确\");\n }\n if (\n value.missingHolidays !== undefined &&\n (!Array.isArray(value.missingHolidays) ||\n !value.missingHolidays.every((name) => typeof name === \"string\" && name.length > 0))\n )\n throw new TypeError(\"缺失节假日说明格式不正确\");\n const dates = new Set<string>();\n for (const day of value.days) {\n if (\n !object(day) ||\n !isISODate(day.date) ||\n typeof day.name !== \"string\" ||\n typeof day.isOffDay !== \"boolean\" ||\n Math.abs(Number(day.date.slice(0, 4)) - Number(value.year)) > 1 ||\n dates.has(day.date)\n ) {\n throw new TypeError(\"节假日日期无效、重复或放假/补班冲突\");\n }\n dates.add(day.date);\n }\n}\n\nexport function validateHolidayData(value: unknown): asserts value is HolidayData {\n if (\n !object(value) ||\n value.schemaVersion !== 1 ||\n !isISODate(value.updatedAt) ||\n !Array.isArray(value.years) ||\n !Array.isArray(value.festivals)\n )\n throw new TypeError(\"节假日 JSON 格式不正确\");\n const years = new Set<number>();\n for (const year of value.years) {\n validateHolidayYear(year);\n if (years.has(year.year)) throw new TypeError(\"节假日年份重复\");\n years.add(year.year);\n }\n if (value.coverage !== undefined) {\n const coverage = value.coverage;\n if (\n !object(coverage) ||\n !Number.isInteger(coverage.startYear) ||\n !Number.isInteger(coverage.endYear) ||\n Number(coverage.startYear) < 1000 ||\n Number(coverage.endYear) > 9999 ||\n Number(coverage.endYear) < Number(coverage.startYear) ||\n !Array.isArray(coverage.missingYears)\n )\n throw new TypeError(\"年份覆盖范围格式不正确\");\n const missing = [];\n for (let year = Number(coverage.startYear); year <= Number(coverage.endYear); year++)\n if (!years.has(year)) missing.push(year);\n if (JSON.stringify(missing) !== JSON.stringify(coverage.missingYears))\n throw new TypeError(\"缺失年份与年度数据不一致\");\n }\n const ids = new Set<string>();\n for (const festival of value.festivals) {\n if (\n !object(festival) ||\n typeof festival.id !== \"string\" ||\n ids.has(festival.id) ||\n typeof festival.name !== \"string\" ||\n !object(festival.rule) ||\n !sourcedText(festival.description) ||\n !sourcedText(festival.origin) ||\n !sourcedText(festival.customs)\n ) {\n throw new TypeError(\"节日资料必须包含介绍、渊源、习俗及各自来源\");\n }\n const rule = festival.rule;\n if (rule.calendar === \"lunar\" || rule.calendar === \"solar\") {\n const maxDay = rule.calendar === \"lunar\" ? 30 : 31;\n if (\n !Number.isInteger(rule.month) ||\n Number(rule.month) < 1 ||\n Number(rule.month) > 12 ||\n !Number.isInteger(rule.day) ||\n Number(rule.day) < 1 ||\n Number(rule.day) > maxDay\n )\n throw new TypeError(\"节日日期规则无效\");\n } else if (rule.calendar === \"solar-term\") {\n if (typeof rule.term !== \"string\" || !rule.term) throw new TypeError(\"节气规则无效\");\n } else if (rule.calendar !== \"lunar-eve\") throw new TypeError(\"未知节日日期规则\");\n ids.add(festival.id);\n }\n}\n\n/** 接受 JSON.parse 后的对象,也接受年度文件;年度输入不会替换其他年份。 */\nexport function parseHolidayData(value: unknown): HolidayData {\n if (object(value) && \"year\" in value) {\n validateHolidayYear(value);\n return { schemaVersion: 1, updatedAt: value.updatedAt, years: [value], festivals: [] };\n }\n validateHolidayData(value);\n return value;\n}\n\nexport function mergeHolidayData(\n base: HolidayData,\n custom: HolidayData | HolidayYear,\n): HolidayData {\n const input = parseHolidayData(custom);\n const years = new Map(base.years.map((year) => [year.year, year]));\n const festivals = new Map(base.festivals.map((festival) => [festival.id, festival]));\n for (const year of input.years) years.set(year.year, year);\n for (const festival of input.festivals) festivals.set(festival.id, festival);\n const range = input.coverage ?? base.coverage;\n const coverage = range\n ? {\n ...range,\n missingYears: Array.from(\n { length: range.endYear - range.startYear + 1 },\n (_, index) => range.startYear + index,\n ).filter((year) => !years.has(year)),\n }\n : undefined;\n return {\n schemaVersion: 1,\n updatedAt: input.updatedAt,\n years: [...years.values()].sort((a, b) => a.year - b.year),\n festivals: [...festivals.values()],\n ...(coverage ? { coverage } : {}),\n };\n}\n","import data from \"../data.json\";\nimport { parseHolidayData } from \"./schema\";\n\nexport * from \"./schema\";\nexport const holidayData = parseHolidayData(data);\nexport function getHolidayYear(year: number) {\n return holidayData.years.find((item) => item.year === year) ?? null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAgB,eAAe,MAAc;CAC3C,OAAO,YAAY,MAAM,MAAM,SAAS,KAAK,SAAS,IAAI,KAAK;AACjE"}
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -87,6 +87,14 @@
|
|
|
87
87
|
"items": {
|
|
88
88
|
"$ref": "#/$defs/day"
|
|
89
89
|
}
|
|
90
|
+
},
|
|
91
|
+
"missingHolidays": {
|
|
92
|
+
"type": "array",
|
|
93
|
+
"items": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"minLength": 1
|
|
96
|
+
},
|
|
97
|
+
"description": "非空表示该年度仅部分收录,列出尚未核实的节假日"
|
|
90
98
|
}
|
|
91
99
|
},
|
|
92
100
|
"required": ["schemaVersion", "year", "updatedAt", "sources", "days"]
|
|
@@ -180,6 +188,25 @@
|
|
|
180
188
|
"items": {
|
|
181
189
|
"$ref": "#/$defs/festival"
|
|
182
190
|
}
|
|
191
|
+
},
|
|
192
|
+
"coverage": {
|
|
193
|
+
"type": "object",
|
|
194
|
+
"properties": {
|
|
195
|
+
"startYear": {
|
|
196
|
+
"type": "integer"
|
|
197
|
+
},
|
|
198
|
+
"endYear": {
|
|
199
|
+
"type": "integer"
|
|
200
|
+
},
|
|
201
|
+
"missingYears": {
|
|
202
|
+
"type": "array",
|
|
203
|
+
"items": {
|
|
204
|
+
"type": "integer"
|
|
205
|
+
},
|
|
206
|
+
"uniqueItems": true
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"required": ["startYear", "endYear", "missingYears"]
|
|
183
210
|
}
|
|
184
211
|
},
|
|
185
212
|
"required": ["schemaVersion", "updatedAt", "years", "festivals"]
|
package/years/2001.json
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"year": 2001,
|
|
4
|
+
"updatedAt": "2026-10-25",
|
|
5
|
+
"sources": [
|
|
6
|
+
{
|
|
7
|
+
"title": "转发国务院办公厅关于2001年春节、“五一”、“十一”放假安排的通知",
|
|
8
|
+
"publisher": "福建省人民政府办公厅",
|
|
9
|
+
"url": "https://zfgb.fj.gov.cn/945",
|
|
10
|
+
"accessedAt": "2026-10-25"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"days": [
|
|
14
|
+
{
|
|
15
|
+
"date": "2001-01-20",
|
|
16
|
+
"name": "春节",
|
|
17
|
+
"isOffDay": false
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "2001-01-21",
|
|
21
|
+
"name": "春节",
|
|
22
|
+
"isOffDay": false
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"date": "2001-01-24",
|
|
26
|
+
"name": "春节",
|
|
27
|
+
"isOffDay": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"date": "2001-01-25",
|
|
31
|
+
"name": "春节",
|
|
32
|
+
"isOffDay": true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "2001-01-26",
|
|
36
|
+
"name": "春节",
|
|
37
|
+
"isOffDay": true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"date": "2001-01-27",
|
|
41
|
+
"name": "春节",
|
|
42
|
+
"isOffDay": true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"date": "2001-01-28",
|
|
46
|
+
"name": "春节",
|
|
47
|
+
"isOffDay": true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "2001-01-29",
|
|
51
|
+
"name": "春节",
|
|
52
|
+
"isOffDay": true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"date": "2001-01-30",
|
|
56
|
+
"name": "春节",
|
|
57
|
+
"isOffDay": true
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"date": "2001-04-28",
|
|
61
|
+
"name": "劳动节",
|
|
62
|
+
"isOffDay": false
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "2001-04-29",
|
|
66
|
+
"name": "劳动节",
|
|
67
|
+
"isOffDay": false
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"date": "2001-05-01",
|
|
71
|
+
"name": "劳动节",
|
|
72
|
+
"isOffDay": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"date": "2001-05-02",
|
|
76
|
+
"name": "劳动节",
|
|
77
|
+
"isOffDay": true
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"date": "2001-05-03",
|
|
81
|
+
"name": "劳动节",
|
|
82
|
+
"isOffDay": true
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"date": "2001-05-04",
|
|
86
|
+
"name": "劳动节",
|
|
87
|
+
"isOffDay": true
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"date": "2001-05-05",
|
|
91
|
+
"name": "劳动节",
|
|
92
|
+
"isOffDay": true
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"date": "2001-05-06",
|
|
96
|
+
"name": "劳动节",
|
|
97
|
+
"isOffDay": true
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"date": "2001-05-07",
|
|
101
|
+
"name": "劳动节",
|
|
102
|
+
"isOffDay": true
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"date": "2001-09-29",
|
|
106
|
+
"name": "国庆节",
|
|
107
|
+
"isOffDay": false
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"date": "2001-09-30",
|
|
111
|
+
"name": "国庆节",
|
|
112
|
+
"isOffDay": false
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"date": "2001-10-01",
|
|
116
|
+
"name": "国庆节",
|
|
117
|
+
"isOffDay": true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"date": "2001-10-02",
|
|
121
|
+
"name": "国庆节",
|
|
122
|
+
"isOffDay": true
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"date": "2001-10-03",
|
|
126
|
+
"name": "国庆节",
|
|
127
|
+
"isOffDay": true
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"date": "2001-10-04",
|
|
131
|
+
"name": "国庆节",
|
|
132
|
+
"isOffDay": true
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"date": "2001-10-05",
|
|
136
|
+
"name": "国庆节",
|
|
137
|
+
"isOffDay": true
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"date": "2001-10-06",
|
|
141
|
+
"name": "国庆节",
|
|
142
|
+
"isOffDay": true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"date": "2001-10-07",
|
|
146
|
+
"name": "国庆节",
|
|
147
|
+
"isOffDay": true
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"missingHolidays": ["元旦"]
|
|
151
|
+
}
|
package/years/2002.json
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"year": 2002,
|
|
4
|
+
"updatedAt": "2026-10-25",
|
|
5
|
+
"sources": [
|
|
6
|
+
{
|
|
7
|
+
"title": "关于2002年部分节假日休息安排的通知",
|
|
8
|
+
"publisher": "福建省人民政府办公厅",
|
|
9
|
+
"url": "https://zfgb.fujian.gov.cn/7038",
|
|
10
|
+
"accessedAt": "2026-10-25"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"days": [
|
|
14
|
+
{
|
|
15
|
+
"date": "2001-12-29",
|
|
16
|
+
"name": "元旦",
|
|
17
|
+
"isOffDay": false
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "2001-12-30",
|
|
21
|
+
"name": "元旦",
|
|
22
|
+
"isOffDay": false
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"date": "2002-01-01",
|
|
26
|
+
"name": "元旦",
|
|
27
|
+
"isOffDay": true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"date": "2002-01-02",
|
|
31
|
+
"name": "元旦",
|
|
32
|
+
"isOffDay": true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "2002-01-03",
|
|
36
|
+
"name": "元旦",
|
|
37
|
+
"isOffDay": true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"date": "2002-02-09",
|
|
41
|
+
"name": "春节",
|
|
42
|
+
"isOffDay": false
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"date": "2002-02-10",
|
|
46
|
+
"name": "春节",
|
|
47
|
+
"isOffDay": false
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "2002-02-12",
|
|
51
|
+
"name": "春节",
|
|
52
|
+
"isOffDay": true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"date": "2002-02-13",
|
|
56
|
+
"name": "春节",
|
|
57
|
+
"isOffDay": true
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"date": "2002-02-14",
|
|
61
|
+
"name": "春节",
|
|
62
|
+
"isOffDay": true
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"date": "2002-02-15",
|
|
66
|
+
"name": "春节",
|
|
67
|
+
"isOffDay": true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"date": "2002-02-16",
|
|
71
|
+
"name": "春节",
|
|
72
|
+
"isOffDay": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"date": "2002-02-17",
|
|
76
|
+
"name": "春节",
|
|
77
|
+
"isOffDay": true
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"date": "2002-02-18",
|
|
81
|
+
"name": "春节",
|
|
82
|
+
"isOffDay": true
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"date": "2002-04-27",
|
|
86
|
+
"name": "劳动节",
|
|
87
|
+
"isOffDay": false
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"date": "2002-04-28",
|
|
91
|
+
"name": "劳动节",
|
|
92
|
+
"isOffDay": false
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"date": "2002-05-01",
|
|
96
|
+
"name": "劳动节",
|
|
97
|
+
"isOffDay": true
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"date": "2002-05-02",
|
|
101
|
+
"name": "劳动节",
|
|
102
|
+
"isOffDay": true
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"date": "2002-05-03",
|
|
106
|
+
"name": "劳动节",
|
|
107
|
+
"isOffDay": true
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"date": "2002-05-04",
|
|
111
|
+
"name": "劳动节",
|
|
112
|
+
"isOffDay": true
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"date": "2002-05-05",
|
|
116
|
+
"name": "劳动节",
|
|
117
|
+
"isOffDay": true
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"date": "2002-05-06",
|
|
121
|
+
"name": "劳动节",
|
|
122
|
+
"isOffDay": true
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"date": "2002-05-07",
|
|
126
|
+
"name": "劳动节",
|
|
127
|
+
"isOffDay": true
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"date": "2002-09-28",
|
|
131
|
+
"name": "国庆节",
|
|
132
|
+
"isOffDay": false
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"date": "2002-09-29",
|
|
136
|
+
"name": "国庆节",
|
|
137
|
+
"isOffDay": false
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"date": "2002-10-01",
|
|
141
|
+
"name": "国庆节",
|
|
142
|
+
"isOffDay": true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"date": "2002-10-02",
|
|
146
|
+
"name": "国庆节",
|
|
147
|
+
"isOffDay": true
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"date": "2002-10-03",
|
|
151
|
+
"name": "国庆节",
|
|
152
|
+
"isOffDay": true
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"date": "2002-10-04",
|
|
156
|
+
"name": "国庆节",
|
|
157
|
+
"isOffDay": true
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"date": "2002-10-05",
|
|
161
|
+
"name": "国庆节",
|
|
162
|
+
"isOffDay": true
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"date": "2002-10-06",
|
|
166
|
+
"name": "国庆节",
|
|
167
|
+
"isOffDay": true
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"date": "2002-10-07",
|
|
171
|
+
"name": "国庆节",
|
|
172
|
+
"isOffDay": true
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
}
|
package/years/2003.json
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"year": 2003,
|
|
4
|
+
"updatedAt": "2026-10-25",
|
|
5
|
+
"sources": [
|
|
6
|
+
{
|
|
7
|
+
"title": "关于2003年部分节假日休息安排的通知(五一原方案已调整,不录入)",
|
|
8
|
+
"publisher": "深圳市人民政府办公厅",
|
|
9
|
+
"url": "https://www.sz.gov.cn/zfgb/2003/gb317/content/post_5004142.html",
|
|
10
|
+
"accessedAt": "2026-10-25"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"title": "国务院新闻办新闻发布会答问记录:因非典暂停五一长假",
|
|
14
|
+
"publisher": "国务院新闻办公室(外交部网站刊载)",
|
|
15
|
+
"url": "https://www.fmprc.gov.cn/ziliao_674904/zt_674979/ywzt_675099/zt2003_675963/2267_675979/200304/t20030420_7965016.shtml",
|
|
16
|
+
"accessedAt": "2026-10-25"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"days": [
|
|
20
|
+
{
|
|
21
|
+
"date": "2003-01-01",
|
|
22
|
+
"name": "元旦",
|
|
23
|
+
"isOffDay": true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "2003-02-01",
|
|
27
|
+
"name": "春节",
|
|
28
|
+
"isOffDay": true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"date": "2003-02-02",
|
|
32
|
+
"name": "春节",
|
|
33
|
+
"isOffDay": true
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"date": "2003-02-03",
|
|
37
|
+
"name": "春节",
|
|
38
|
+
"isOffDay": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"date": "2003-02-04",
|
|
42
|
+
"name": "春节",
|
|
43
|
+
"isOffDay": true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"date": "2003-02-05",
|
|
47
|
+
"name": "春节",
|
|
48
|
+
"isOffDay": true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"date": "2003-02-06",
|
|
52
|
+
"name": "春节",
|
|
53
|
+
"isOffDay": true
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"date": "2003-02-07",
|
|
57
|
+
"name": "春节",
|
|
58
|
+
"isOffDay": true
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"date": "2003-02-08",
|
|
62
|
+
"name": "春节",
|
|
63
|
+
"isOffDay": false
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"date": "2003-02-09",
|
|
67
|
+
"name": "春节",
|
|
68
|
+
"isOffDay": false
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"date": "2003-09-27",
|
|
72
|
+
"name": "国庆节",
|
|
73
|
+
"isOffDay": false
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"date": "2003-09-28",
|
|
77
|
+
"name": "国庆节",
|
|
78
|
+
"isOffDay": false
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"date": "2003-10-01",
|
|
82
|
+
"name": "国庆节",
|
|
83
|
+
"isOffDay": true
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"date": "2003-10-02",
|
|
87
|
+
"name": "国庆节",
|
|
88
|
+
"isOffDay": true
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"date": "2003-10-03",
|
|
92
|
+
"name": "国庆节",
|
|
93
|
+
"isOffDay": true
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"date": "2003-10-04",
|
|
97
|
+
"name": "国庆节",
|
|
98
|
+
"isOffDay": true
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"date": "2003-10-05",
|
|
102
|
+
"name": "国庆节",
|
|
103
|
+
"isOffDay": true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"date": "2003-10-06",
|
|
107
|
+
"name": "国庆节",
|
|
108
|
+
"isOffDay": true
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"date": "2003-10-07",
|
|
112
|
+
"name": "国庆节",
|
|
113
|
+
"isOffDay": true
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"missingHolidays": ["劳动节(非典期间调整后的最终安排待核实)"]
|
|
117
|
+
}
|