forked from holidays/definitions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
se.yaml
238 lines (236 loc) · 5.04 KB
/
se.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
235
236
237
238
# Swedish holiday definitions for the Ruby Holiday gem.
#
# Updated: 2008-11-28.
# Sources:
# - http://en.wikipedia.org/wiki/Holidays_in_Sweden
# - http://www.worldtravelguide.net/country/269/public_holidays/Europe/Sweden.html
# - http://hem.passagen.se/farila/midsum.htm
# - http://www.timeanddate.com/calendar/?country=21
---
months:
0:
- name: Långfredagen
regions: [se]
function: easter(year)
function_modifier: -2
- name: Påskafton
regions: [se]
function: easter(year)
function_modifier: -1
type: informal
- name: Påskdagen
regions: [se]
function: easter(year)
- name: Annandag påsk
regions: [se]
function: easter(year)
function_modifier: 1
- name: Kristi himmelsfärdsdag # Ascension Day
regions: [se]
function: easter(year)
function_modifier: 39
- name: Pingstdagen # Whitsunday
regions: [se]
function: easter(year)
function_modifier: 49
- name: Alla helgons dag # All Saint's Day
regions: [se]
function: se_alla_helgons_dag(year)
1:
- name: Nyårsdagen
regions: [se]
mday: 1
- name: Trettondedag jul
regions: [se]
mday: 6
5:
- name: Första maj
regions: [se]
mday: 1
6:
- name: Nationaldagen
regions: [se]
mday: 6
- name: Midsommardagen
regions: [se]
function: se_midsommardagen(year)
- name: Midsommarafton
regions: [se]
function: se_midsommardagen(year)
function_modifier: -1
type: informal
12:
- name: Julafton
regions: [se]
mday: 24
type: informal
- name: Juldagen
regions: [se]
mday: 25
- name: Annandag jul
regions: [se]
mday: 26
- name: Nyårsafton
regions: [se]
mday: 31
type: informal
methods:
se_midsommardagen:
# Sweden: Mid-summer (Saturday between June 20–26)
arguments: year
ruby: |
date = Date.civil(year,6,20)
date += (6 - date.wday)
date
se_alla_helgons_dag:
# Sweden: 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: ["se"]
options: ["informal"]
expect:
name: "Nyårsdagen"
- given:
date: '2008-01-06'
regions: ["se"]
options: ["informal"]
expect:
name: "Trettondedag jul"
- given:
date: '2008-03-21'
regions: ["se"]
options: ["informal"]
expect:
name: "Långfredagen"
- given:
date: '2008-03-22'
regions: ["se"]
options: ["informal"]
expect:
name: "Påskafton"
- given:
date: '2008-03-23'
regions: ["se"]
options: ["informal"]
expect:
name: "Påskdagen"
- given:
date: '2008-03-24'
regions: ["se"]
options: ["informal"]
expect:
name: "Annandag påsk"
- given:
date: '2008-05-01'
regions: ["se"]
options: ["informal"]
expect:
name: "Kristi himmelsfärdsdag"
- given:
date: '2008-05-11'
regions: ["se"]
options: ["informal"]
expect:
name: "Pingstdagen"
- given:
date: '2008-06-06'
regions: ["se"]
options: ["informal"]
expect:
name: "Nationaldagen"
- given:
date: '2005-06-25'
regions: ["se"]
options: ["informal"]
expect:
name: "Midsommardagen"
- given:
date: '2006-06-24'
regions: ["se"]
options: ["informal"]
expect:
name: "Midsommardagen"
- given:
date: '2006-06-23'
regions: ["se"]
options: ["informal"]
expect:
name: "Midsommarafton"
- given:
date: '2007-06-23'
regions: ["se"]
options: ["informal"]
expect:
name: "Midsommardagen"
- given:
date: '2007-06-22'
regions: ["se"]
options: ["informal"]
expect:
name: "Midsommarafton"
- given:
date: '2008-06-21'
regions: ["se"]
options: ["informal"]
expect:
name: "Midsommardagen"
- given:
date: '2008-06-20'
regions: ["se"]
options: ["informal"]
expect:
name: "Midsommarafton"
- given:
date: '2005-11-05'
regions: ["se"]
options: ["informal"]
expect:
name: "Alla helgons dag"
- given:
date: '2006-11-04'
regions: ["se"]
options: ["informal"]
expect:
name: "Alla helgons dag"
- given:
date: '2007-11-03'
regions: ["se"]
options: ["informal"]
expect:
name: "Alla helgons dag"
- given:
date: '2008-11-01'
regions: ["se"]
options: ["informal"]
expect:
name: "Alla helgons dag"
- given:
date: '2008-12-24'
regions: ["se"]
options: ["informal"]
expect:
name: "Julafton"
- given:
date: '2008-12-25'
regions: ["se"]
options: ["informal"]
expect:
name: "Juldagen"
- given:
date: '2008-12-26'
regions: ["se"]
options: ["informal"]
expect:
name: "Annandag jul"
- given:
date: '2008-12-31'
regions: ["se"]
options: ["informal"]
expect:
name: "Nyårsafton"