-
Notifications
You must be signed in to change notification settings - Fork 136
/
fi.yaml
234 lines (232 loc) · 4.93 KB
/
fi.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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# Finnish holiday definitions for the Ruby Holiday gem.
#
# Updated: 2010-12-28.
# Sources:
# - http://en.wikipedia.org/wiki/Public_holidays_in_Finland
---
months:
0:
- name: Pitkäperjantai
regions: [fi]
function: easter(year)
function_modifier: -2
- name: Pääsiäispäivä
regions: [fi]
function: easter(year)
- name: 2. Pääsiäispäivä
regions: [fi]
function: easter(year)
function_modifier: 1
- name: Helatorstai # Ascension Day
regions: [fi]
function: easter(year)
function_modifier: 39
- name: Helluntaipäivä # Whitsunday
regions: [fi]
function: easter(year)
function_modifier: 49
- name: Pyhäinpäivä # All Saint's Day
regions: [fi]
function: fi_pyhainpaiva(year)
1:
- name: Uudenvuodenpäivä
regions: [fi]
mday: 1
- name: Loppiainen
regions: [fi]
mday: 6
5:
- name: Vappu
regions: [fi]
mday: 1
6:
- name: Juhannusaatto
regions: [fi]
function: fi_juhannusaatto(year)
- name: Juhannuspäivä
regions: [fi]
function: fi_juhannuspaiva(year)
12:
- name: Itsenäisyyspäivä
regions: [fi]
mday: 6
- name: Jouluaatto
regions: [fi]
mday: 24
- name: Joulupäivä
regions: [fi]
mday: 25
- name: Tapaninpäivä
regions: [fi]
mday: 26
methods:
fi_juhannusaatto:
# Finland: Mid-summer eve (Friday between June 19–25)
arguments: year
ruby: |
date = Date.civil(year,6,19)
if date.wday > 5 #if 19.6 is saturday
date += 6
else
date += (5 - date.wday)
end
date
fi_juhannuspaiva:
# Finland: Mid-summer (Saturday between June 20–26)
arguments: year
ruby: |
date = Date.civil(year,6,20)
date += (6 - date.wday)
date
fi_pyhainpaiva:
# Finland: All Saint's Day (Saturday between Oct 31 and Nov 6)
arguments: year
ruby: |
date = Date.civil(year,10,31)
date += (6 - date.wday)
date
tests:
- given:
date: '2008-01-01'
regions: ["fi"]
options: ["informal"]
expect:
name: "Uudenvuodenpäivä"
- given:
date: '2008-01-06'
regions: ["fi"]
options: ["informal"]
expect:
name: "Loppiainen"
- given:
date: '2008-03-21'
regions: ["fi"]
options: ["informal"]
expect:
name: "Pitkäperjantai"
- given:
date: '2008-03-23'
regions: ["fi"]
options: ["informal"]
expect:
name: "Pääsiäispäivä"
- given:
date: '2008-03-24'
regions: ["fi"]
options: ["informal"]
expect:
name: "2. Pääsiäispäivä"
- given:
date: '2008-05-01'
regions: ["fi"]
options: ["informal"]
expect:
name: "Helatorstai"
- given:
date: '2008-05-11'
regions: ["fi"]
options: ["informal"]
expect:
name: "Helluntaipäivä"
- given:
date: '2009-06-19'
regions: ["fi"]
options: ["informal"]
expect:
name: "Juhannusaatto"
- given:
date: '2010-06-25'
regions: ["fi"]
options: ["informal"]
expect:
name: "Juhannusaatto"
- given:
date: '2011-06-24'
regions: ["fi"]
options: ["informal"]
expect:
name: "Juhannusaatto"
- given:
date: '2012-06-22'
regions: ["fi"]
options: ["informal"]
expect:
name: "Juhannusaatto"
- given:
date: '2013-06-21'
regions: ["fi"]
options: ["informal"]
expect:
name: "Juhannusaatto"
- given:
date: '2005-06-25'
regions: ["fi"]
options: ["informal"]
expect:
name: "Juhannuspäivä"
- given:
date: '2006-06-24'
regions: ["fi"]
options: ["informal"]
expect:
name: "Juhannuspäivä"
- given:
date: '2007-06-23'
regions: ["fi"]
options: ["informal"]
expect:
name: "Juhannuspäivä"
- given:
date: '2008-06-21'
regions: ["fi"]
options: ["informal"]
expect:
name: "Juhannuspäivä"
- given:
date: '2005-11-05'
regions: ["fi"]
options: ["informal"]
expect:
name: "Pyhäinpäivä"
- given:
date: '2006-11-04'
regions: ["fi"]
options: ["informal"]
expect:
name: "Pyhäinpäivä"
- given:
date: '2007-11-03'
regions: ["fi"]
options: ["informal"]
expect:
name: "Pyhäinpäivä"
- given:
date: '2008-11-01'
regions: ["fi"]
options: ["informal"]
expect:
name: "Pyhäinpäivä"
- given:
date: '2008-12-06'
regions: ["fi"]
options: ["informal"]
expect:
name: "Itsenäisyyspäivä"
- given:
date: '2008-12-24'
regions: ["fi"]
options: ["informal"]
expect:
name: "Jouluaatto"
- given:
date: '2008-12-25'
regions: ["fi"]
options: ["informal"]
expect:
name: "Joulupäivä"
- given:
date: '2008-12-26'
regions: ["fi"]
options: ["informal"]
expect:
name: "Tapaninpäivä"