forked from TandaHQ/definitions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nz2_calendar_dates.yaml
196 lines (193 loc) · 4.38 KB
/
nz2_calendar_dates.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# New Zealand holiday definitions. Two options, paid as per the 'week day' or this paid on the specific calendar day
# Updated: 2010-03-28.
# Sources:
# - http://en.wikipedia.org/wiki/Public_holidays_in_New_Zealand
---
months:
0:
- name: Good Friday
regions: [nz2_calendar_dates]
function: easter(year)
function_modifier: -2
- name: Easter Monday
regions: [nz2_calendar_dates]
function: easter(year)
function_modifier: 1
1:
- name: New Year's Day
regions: [nz2_calendar_dates]
mday: 1
- name: Day after New Year's Day
regions: [nz2_calendar_dates]
mday: 2
2:
- name: Waitangi Day
regions: [nz2_calendar_dates]
mday: 6
4:
- name: ANZAC Day
regions: [nz2_calendar_dates]
mday: 25
6:
- name: Queen's Birthday
regions: [nz2_calendar_dates]
week: 1
wday: 1
- name: Matariki Holiday
regions: [nz2_calendar_dates]
function: matariki_holiday(year)
9:
- name: Day of mourning for Queen Elizabeth II
regions: [nz2_calendar_dates]
mday: 26
year_ranges:
- limited: 2022
10:
- name: Labour Day
regions: [nz2_calendar_dates]
week: 4
wday: 1
12:
- name: Christmas Day
regions: [nz2_calendar_dates]
mday: 25
- name: Boxing Day
regions: [nz2_calendar_dates]
mday: 26
tests:
- given:
date: '2007-01-01'
regions: ["nz2_calendar_dates"]
options: ["informal"]
expect:
name: "New Year's Day"
- given:
date: '2007-01-02'
regions: ["nz2_calendar_dates"]
options: ["informal"]
expect:
name: "Day after New Year's Day"
- given:
date: '2007-02-06'
regions: ["nz2_calendar_dates"]
options: ["informal"]
expect:
name: "Waitangi Day"
- given:
date: '2007-04-06'
regions: ["nz2_calendar_dates"]
options: ["informal"]
expect:
name: "Good Friday"
- given:
date: '2007-04-09'
regions: ["nz2_calendar_dates"]
options: ["informal"]
expect:
name: "Easter Monday"
- given:
date: '2007-04-25'
regions: ["nz2_calendar_dates"]
options: ["informal"]
expect:
name: "ANZAC Day"
- given:
date: '2007-12-25'
regions: ["nz2_calendar_dates"]
options: ["informal"]
expect:
name: "Christmas Day"
- given:
date: '2007-12-26'
regions: ["nz2_calendar_dates"]
options: ["informal"]
expect:
name: "Boxing Day"
- given:
date: '2015-04-25'
regions: ["nz2_calendar_dates"]
expect:
name: "ANZAC Day"
- given:
date: '2016-04-25'
regions: ["nz2_calendar_dates"]
expect:
name: "ANZAC Day"
- given:
date: '2015-02-06'
regions: ["nz2_calendar_dates"]
expect:
name: "Waitangi Day"
- given:
date: '2016-02-06'
regions: ["nz2_calendar_dates"]
expect:
name: "Waitangi Day"
methods:
matariki_holiday:
arguments: year
source: |
case year
when 2022
Date.civil(2022, 6, 24)
when 2023
Date.civil(2023, 7, 14)
when 2024
Date.civil(2024, 6, 28)
when 2025
Date.civil(2025, 6, 20)
when 2026
Date.civil(2026, 7, 10)
when 2027
Date.civil(2027, 6, 25)
when 2028
Date.civil(2028, 7, 14)
when 2029
Date.civil(2029, 7, 6)
when 2030
Date.civil(2030, 6, 21)
when 2031
Date.civil(2031, 7, 11)
when 2032
Date.civil(2032, 7, 2)
when 2033
Date.civil(2033, 6, 24)
when 2034
Date.civil(2034, 7, 7)
when 2035
Date.civil(2035, 6, 29)
when 2036
Date.civil(2036, 7, 21)
when 2037
Date.civil(2037, 7, 10)
when 2038
Date.civil(2038, 6, 25)
when 2039
Date.civil(2039, 7, 15)
when 2040
Date.civil(2040, 7, 6)
when 2041
Date.civil(2041, 7, 19)
when 2042
Date.civil(2042, 7, 11)
when 2043
Date.civil(2043, 7, 3)
when 2044
Date.civil(2044, 6, 24)
when 2045
Date.civil(2045, 7, 7)
when 2046
Date.civil(2046, 6, 29)
when 2047
Date.civil(2047, 7, 19)
when 2048
Date.civil(2048, 7, 3)
when 2049
Date.civil(2049, 6, 25)
when 2050
Date.civil(2050, 7, 15)
when 2051
Date.civil(2051, 6, 30)
when 2052
Date.civil(2052, 6, 25)
end