forked from holidays/definitions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lv.yaml
229 lines (227 loc) · 6.7 KB
/
lv.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
# Latvian holiday definitions for the Ruby Holiday gem.
#
# Updated: 2023-05-29
# Sources:
# - https://likumi.lv/ta/id/72608 (Likums "Par svētku, atceres un atzīmējamām dienām")
---
months:
0:
- name: Lielā Piektdiena # Good Friday
regions: [lv]
function: easter(year)
function_modifier: -2
- name: Pirmās Lieldienas # Easter Sunday
regions: [lv]
function: easter(year)
- name: Otrās Lieldienas # Easter Monday
regions: [lv]
function: easter(year)
function_modifier: 1
- name: Vasarsvētki # Summer's Day / Pentecost
regions: [lv]
function: easter(year)
function_modifier: 49
- name: Vispārējo latviešu Dziesmu un deju svētku noslēguma diena
regions: [lv]
function: lv_song_and_dance_festival_end_date(year)
observed: to_monday_if_weekend(date)
year_ranges:
from: 2018
1:
- name: Jaungada diena # New Year's Day
regions: [lv]
mday: 1
5:
- name: Darba svētki, Latvijas Republikas Satversmes sapulces sasaukšanas diena # Labor day, Anniversary of the Convocation of the Constitutional Assembly of the Republic of Latvia
regions: [lv]
mday: 1
- name: Latvijas Republikas Neatkarības atjaunošanas diena # Day of the Restoration of Independence of the Republic of Latvia
regions: [lv]
mday: 4
observed: to_monday_if_weekend(date)
- name: Mātes diena # Mother's Day
regions: [lv]
week: 2
wday: 0
- name: "Diena, kad Latvijas hokeja komanda ieguva bronzas medaļu 2023. gada Pasaules hokeja čempionātā" # Latvia team 2023 IIHF World Championship bronze medal win
regions: [lv]
mday: 29
year_ranges:
limited: [2023]
6:
- name: Līgo diena # Midsummer
regions: [lv]
mday: 23
- name: Jāņu diena # Midsummer
regions: [lv]
mday: 24
9:
- name: Viņa Svētības pāvesta Franciska pastorālās vizītes Latvijā diena # Visit of Pope Francis
regions: [lv]
mday: 24
year_ranges:
limited: [2018]
11:
- name: Latvijas Republikas Proklamēšanas diena # Proclamation Day of the Republic of Latvia
regions: [lv]
mday: 18
observed: to_monday_if_weekend(date)
12:
- name: Ziemassvētku vakars # Christmas Eve
regions: [lv]
mday: 24
- name: Pirmie Ziemassvētki # Christmas Day
regions: [lv]
mday: 25
- name: Otrie Ziemassvētki # Boxing Day
regions: [lv]
mday: 26
- name: Vecgada diena # New Year's Eve
regions: [lv]
mday: 31
methods:
lv_song_and_dance_festival_end_date:
arguments: year
ruby: |
case year
when 2018
# https://likumi.lv/ta/id/281541 (Ministru kabineta rīkojums Nr. 252 "Par XXVI Vispārējo latviešu dziesmu un XVI Deju svētku norises laiku")
Date.new(2018, 7, 8)
when 2023
# https://likumi.lv/ta/id/330067 (Ministru kabineta rīkojums Nr. 92 "Par XXVII Vispārējo latviešu dziesmu un XVII Deju svētku norises laiku")
Date.new(2023, 7, 9)
when 2028
# Event's period/next year is known, but precise dates aren't.
# Previously, dates were announced 2 years ahead, so on ~2026-05 this method would need to be revisited.
end
tests:
- given:
date: ['2018-01-01', '2019-01-01', '2029-01-01']
regions: ["lv"]
expect:
name: "Jaungada diena"
- given:
date: ['2018-03-30', '2019-04-19', '2039-04-08']
regions: ["lv"]
expect:
name: "Lielā Piektdiena"
- given:
date: ['2018-04-01', '2019-04-21', '2039-04-10']
regions: ["lv"]
expect:
name: "Pirmās Lieldienas"
- given:
date: ['2018-04-02', '2019-04-22', '2039-04-11']
regions: ["lv"]
expect:
name: "Otrās Lieldienas"
- given:
date: ['2018-05-01', '2019-05-01', '2029-05-01']
regions: ["lv"]
expect:
name: "Darba svētki, Latvijas Republikas Satversmes sapulces sasaukšanas diena"
- given:
date: ['2018-05-04', '2019-05-04', '2020-05-04']
regions: ["lv"]
expect:
name: "Latvijas Republikas Neatkarības atjaunošanas diena"
- given:
date: '2019-05-06'
regions: ["lv"]
options: ["observed"]
expect:
name: "Latvijas Republikas Neatkarības atjaunošanas diena"
- given:
date: '2020-05-04'
regions: ["lv"]
options: ["observed"]
expect:
name: "Latvijas Republikas Neatkarības atjaunošanas diena"
- given:
date: ['2019-05-12', '2020-05-10', '2029-05-13']
regions: ["lv"]
expect:
name: "Mātes diena"
- given:
date: '2023-05-29'
regions: ["lv"]
expect:
name: "Diena, kad Latvijas hokeja komanda ieguva bronzas medaļu 2023. gada Pasaules hokeja čempionātā"
- given:
date: ['2019-06-09', '2020-05-31', '2029-05-20']
regions: ["lv"]
expect:
name: "Vasarsvētki"
- given:
date: ['2019-06-23', '2020-06-23', '2029-06-23']
regions: ["lv"]
expect:
name: "Līgo diena"
- given:
date: ['2019-06-24', '2020-06-24', '2029-06-24']
regions: ["lv"]
expect:
name: "Jāņu diena"
- given:
date: ['2018-07-08', '2023-07-09']
regions: ["lv"]
expect:
name: "Vispārējo latviešu Dziesmu un deju svētku noslēguma diena"
- given:
date: ['2018-07-09', '2023-07-10']
regions: ["lv"]
options: ["observed"]
expect:
name: "Vispārējo latviešu Dziesmu un deju svētku noslēguma diena"
- given:
date: ['2019-07-08', '2019-07-09', '2022-07-08', '2022-07-09', '2024-07-08', '2024-07-09']
regions: ["lv"]
expect:
holiday: false
- given:
date: '2018-09-24'
regions: ["lv"]
expect:
name: "Viņa Svētības pāvesta Franciska pastorālās vizītes Latvijā diena"
- given:
date: '2019-09-24'
regions: ["lv"]
expect:
holiday: false
- given:
date: ['2019-11-18', '2020-11-18', '2029-11-18']
regions: ["lv"]
expect:
name: "Latvijas Republikas Proklamēšanas diena"
- given:
date: '2020-11-18'
regions: ["lv"]
options: ["observed"]
expect:
name: "Latvijas Republikas Proklamēšanas diena"
- given:
date: '2029-11-19'
regions: ["lv"]
options: ["observed"]
expect:
name: "Latvijas Republikas Proklamēšanas diena"
- given:
date: ['2019-12-24', '2020-12-24', '2029-12-24']
regions: ["lv"]
expect:
name: "Ziemassvētku vakars"
- given:
date: ['2019-12-25', '2020-12-25', '2029-12-25']
regions: ["lv"]
expect:
name: "Pirmie Ziemassvētki"
- given:
date: ['2019-12-26', '2020-12-26', '2029-12-26']
regions: ["lv"]
expect:
name: "Otrie Ziemassvētki"
- given:
date: ['2019-12-31', '2020-12-31', '2029-12-31']
regions: ["lv"]
expect:
name: "Vecgada diena"