Skip to content

Commit 7687d54

Browse files
author
wero
committed
support 2024
1 parent 56fe814 commit 7687d54

File tree

4 files changed

+68
-2
lines changed

4 files changed

+68
-2
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.Phony: script
2+
3+
script:
4+
go run scripts/generator.go

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 中国节假日
22

33
判断某年某月某一天是不是工作日/节假日。
4-
支持 2004年 至 2022年,包括 2020年 的春节延长。
4+
支持 2004年 至 2024年,包括 2020年 的春节延长。
55

66
## 使用
77
``` go

constants.go

Lines changed: 45 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generator.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,24 @@ func (ag *arrangement) generateHolidays() {
9797
sort.Sort(ag.InLieuDayList)
9898
}
9999

100+
func (ag *arrangement) Y2024() {
101+
// 一、元旦:1月1日放假,与周末连休。
102+
// 二、春节:2月10日至17日放假调休,共8天。2月4日(星期日)、2月18日(星期日)上班。
103+
// 三、清明节:4月4日至6日放假调休,共3天。4月7日(星期日)上班。
104+
// 四、劳动节:5月1日至5日放假调休,共5天。4月28日(星期日)、5月11日(星期六)上班。
105+
// 五、端午节:6月10日放假,与周末连休。
106+
// 六、中秋节:9月15日至17日放假调休,共3天。9月14日(星期六)上班。
107+
// 七、国庆节:10月1日至7日放假调休,共7天。9月29日(星期日)、10月12日(星期六)上班。
108+
ag.yearAt(2024).
109+
nyd().rest(1, 1).
110+
sf().rest(2, 10).to(2, 17).work(2, 4).work(2, 18).inLieu(2, 15).to(2, 16).
111+
tsd().rest(4, 4).to(4, 6).work(4, 7).inLieu(4, 5).
112+
ld().rest(5, 1).to(5, 5).work(4, 28).work(5, 11).inLieu(5, 2).to(5, 3).
113+
dbf().rest(6, 10).
114+
maf().rest(9, 15).to(9, 17).work(9, 14).inLieu(9, 17).
115+
nd().rest(10, 1).to(10, 7).work(9, 29).work(10, 12).inLieu(10, 4).inLieu(10, 7)
116+
}
117+
100118
func (ag *arrangement) Y2023() {
101119
// http://www.gov.cn/zhengce/content/2022-12/08/content_5730844.htm
102120
// 一、元旦:2022年1月1日至3日放假,共3天。

0 commit comments

Comments
 (0)