holidays 4.7.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/CHANGELOG.md +9 -0
  4. data/CONTRIBUTING.md +21 -11
  5. data/Makefile +9 -6
  6. data/holidays.gemspec +1 -1
  7. data/lib/generated_definitions/MANIFEST +1 -0
  8. data/lib/generated_definitions/REGIONS.rb +1 -1
  9. data/lib/generated_definitions/hk.rb +112 -0
  10. data/lib/generated_definitions/kr.rb +4 -4
  11. data/lib/holidays/errors.rb +1 -0
  12. data/lib/holidays/finder/context/parse_options.rb +8 -3
  13. data/lib/holidays/load_all_definitions.rb +0 -11
  14. data/lib/holidays/version.rb +1 -1
  15. data/test/defs/test_defs_hk.rb +38 -0
  16. data/test/defs/test_defs_jp.rb +1 -0
  17. data/test/defs/test_defs_kr.rb +1 -1
  18. data/test/holidays/definition/validator/test_region.rb +4 -0
  19. data/test/holidays/finder/context/test_parse_options.rb +9 -1
  20. data/test/integration/test_all_regions.rb +4 -4
  21. data/test/integration/test_custom_holidays.rb +4 -4
  22. data/test/integration/test_holidays.rb +6 -6
  23. metadata +6 -60
  24. data/definitions/README.md +0 -353
  25. data/definitions/ar.yaml +0 -93
  26. data/definitions/at.yaml +0 -72
  27. data/definitions/au.yaml +0 -378
  28. data/definitions/be_fr.yaml +0 -69
  29. data/definitions/be_nl.yaml +0 -69
  30. data/definitions/bg.yaml +0 -127
  31. data/definitions/br.yaml +0 -77
  32. data/definitions/ca.yaml +0 -317
  33. data/definitions/ch.yaml +0 -193
  34. data/definitions/cl.yaml +0 -94
  35. data/definitions/cr.yaml +0 -65
  36. data/definitions/cz.yaml +0 -73
  37. data/definitions/de.yaml +0 -209
  38. data/definitions/dk.yaml +0 -130
  39. data/definitions/ecb_target.yaml +0 -44
  40. data/definitions/el.yaml +0 -84
  41. data/definitions/es.yaml +0 -203
  42. data/definitions/federal_reserve.yaml +0 -114
  43. data/definitions/fedex.yaml +0 -62
  44. data/definitions/fi.yaml +0 -115
  45. data/definitions/fr.yaml +0 -79
  46. data/definitions/gb.yaml +0 -151
  47. data/definitions/hr.yaml +0 -79
  48. data/definitions/hu.yaml +0 -63
  49. data/definitions/ie.yaml +0 -89
  50. data/definitions/index.yaml +0 -61
  51. data/definitions/is.yaml +0 -146
  52. data/definitions/it.yaml +0 -67
  53. data/definitions/jp.yaml +0 -321
  54. data/definitions/kr.yaml +0 -282
  55. data/definitions/li.yaml +0 -107
  56. data/definitions/lt.yaml +0 -89
  57. data/definitions/lu.yaml +0 -56
  58. data/definitions/ma.yaml +0 -52
  59. data/definitions/mx.yaml +0 -106
  60. data/definitions/my.yaml +0 -51
  61. data/definitions/nerc.yaml +0 -51
  62. data/definitions/nl.yaml +0 -73
  63. data/definitions/no.yaml +0 -90
  64. data/definitions/north_america_informal.yaml +0 -61
  65. data/definitions/nyse.yaml +0 -64
  66. data/definitions/nz.yaml +0 -163
  67. data/definitions/pe.yaml +0 -119
  68. data/definitions/ph.yaml +0 -94
  69. data/definitions/pl.yaml +0 -320
  70. data/definitions/pt.yaml +0 -89
  71. data/definitions/ro.yaml +0 -78
  72. data/definitions/se.yaml +0 -120
  73. data/definitions/sg.yaml +0 -56
  74. data/definitions/si.yaml +0 -86
  75. data/definitions/sk.yaml +0 -80
  76. data/definitions/united_nations.yaml +0 -189
  77. data/definitions/ups.yaml +0 -62
  78. data/definitions/us.yaml +0 -103
  79. data/definitions/ve.yaml +0 -74
  80. data/definitions/vi.yaml +0 -29
  81. data/definitions/za.yaml +0 -80
@@ -1,193 +0,0 @@
1
- # Swiss holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2012-03-16.
4
- # Sources:
5
- # http://www.bj.admin.ch/content/dam/data/staat_buerger/zivilprozessrecht/kant-feiertage.pdf
6
- #
7
- # Word of warning:
8
- # ================
9
- # As the holidays are defined on a state level and sometimes even on a district / village level,
10
- # this holiday definition is an approximation of the reality. It should be accurate for most of the cases but
11
- # no guarantee is given that it is correct for all the special cases :-).
12
- # Considers both official holidays and holidays that are handled as if they were official holidays.
13
- #
14
- # Holiday names are in German in case they are celebrated in the German speaking area and in French / Italian otherwise.
15
- #
16
- # Known Issues:
17
- # * ch_ur: 26th of December is not celebrated in case the 25th is a Monday or a Friday.
18
- # * ch_fr: Fronleichnam, Maria Himmelfahrt, Allerheiligen, Maria Empfaengnis is celebrated in all villages except
19
- # some villages of the district of See.
20
- # * ch_so: - There are a lot of village holidays not included here.
21
- # - 1st of May is holiday only starting at noon; not included here.
22
- # - 19th of March is celebrated only in a couple of villages
23
- # * ch_ar: 26th of December is not celebrated in case the 25th is a Monday or a Friday.
24
- # * ch_ai: - 22nd of September is celebrated only in part of the state.
25
- # - 26th of December is not celebrated in case the 25th is a Monday or a Friday.
26
- # * ch_ne: 26th of December and 2nd of January are only celebrated in case 25th of December and 1st of January are Sundays
27
- #
28
- #
29
- #
30
- # all regions [ch_zh, ch_be, ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_gl, ch_zg, ch_fr, ch_so, ch_bs, ch_bl,
31
- # ch_sh, ch_ar, ch_ai, ch_sg, ch_gr, ch_ag, ch_tg, ch_ti, ch_vd, ch_vs, ch_ne, ch_ge, ch_ju]
32
- #
33
- ---
34
- months:
35
- 0:
36
- - name: Karfreitag
37
- regions: [ch_zh, ch_be, ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_gl, ch_zg, ch_fr, ch_so, ch_bs, ch_bl, ch_sh, ch_ar, ch_ai, ch_sg, ch_gr, ch_ag, ch_tg, ch_ti, ch_vd, ch_ne, ch_ge, ch_ju]
38
- function: easter(year)
39
- function_modifier: -2
40
- - name: Ostermontag
41
- regions: [ch_zh, ch_be, ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_gl, ch_zg, ch_fr, ch_so, ch_bs, ch_bl, ch_sh, ch_ar, ch_ai, ch_sg, ch_gr, ch_ag, ch_tg, ch_ti, ch_vd, ch_vs, ch_ge, ch_ju]
42
- function: easter(year)
43
- function_modifier: 1
44
- # State holiday but observed in all the states
45
- - name: Auffahrt
46
- regions: [ch]
47
- function: easter(year)
48
- function_modifier: 39
49
- - name: Pfingstmontag
50
- regions: [ch_zh, ch_be, ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_gl, ch_zg, ch_fr, ch_so, ch_bs, ch_bl, ch_sh, ch_ar, ch_ai, ch_sg, ch_gr, ch_ag, ch_tg, ch_ti, ch_vd, ch_vs, ch_ge, ch_ju]
51
- function: easter(year)
52
- function_modifier: 50
53
- - name: Fronleichnam
54
- regions: [ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_zg, ch_fr, ch_so, ch_ai, ch_ag, ch_ti, ch_vs, ch_ne, ch_ju]
55
- function: easter(year)
56
- function_modifier: 60
57
- - name: Lundi du Jeûne fédéral
58
- regions: [ch_vd]
59
- function: ch_vd_lundi_du_jeune_federal(year)
60
- - name: Jeûne genevois
61
- regions: [ch_ge]
62
- function: ch_ge_jeune_genevois(year)
63
- 1:
64
- - name: Neujahrstag
65
- regions: [ch_zh, ch_be, ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_gl, ch_zg, ch_fr, ch_so, ch_bs, ch_bl, ch_sh, ch_ar, ch_ai, ch_sg, ch_gr, ch_ag, ch_tg, ch_vd, ch_vs, ch_ne, ch_ge, ch_ju, ch_ti]
66
- mday: 1
67
- - name: Berchtoldstag
68
- regions: [ch_zh, ch_be, ch_lu, ch_ow, ch_nw, ch_gl, ch_zg, ch_fr, ch_so, ch_sh, ch_sg, ch_ag, ch_tg, ch_vd, ch_vs, ch_ne, ch_ju]
69
- mday: 2
70
- - name: Dreikönigstag
71
- regions: [ch_ur, ch_sz, ch_ti]
72
- mday: 6
73
- 3:
74
- - name: Instauration de la République
75
- regions: [ch_ne]
76
- mday: 1
77
- - name: Josephstag
78
- regions: [ch_ur, ch_sz, ch_nw, ch_ti, ch_vs]
79
- mday: 19
80
- 4:
81
- - name: Näfelser Fahrt
82
- regions: [ch_gl]
83
- function: ch_gl_naefelser_fahrt(year)
84
- 5:
85
- - name: Tag der Arbeit
86
- regions: [ch_zh, ch_bs, ch_bl, ch_sh, ch_ag, ch_tg, ch_ti, ch_ne, ch_ju]
87
- mday: 1
88
- 6:
89
- - name: Commémoration du plébiscite jurassien
90
- regions: [ch_ju]
91
- mday: 23
92
- - name: San Pietro e Paolo
93
- regions: [ch_ti]
94
- mday: 29
95
- 8:
96
- # Federal holiday
97
- - name: Bundesfeiertag
98
- regions: [ch]
99
- mday: 1
100
- - name: Mariä Himmelfahrt
101
- regions: [ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_zg, ch_fr, ch_so, ch_ai, ch_ag, ch_ti, ch_vs, ch_ju]
102
- mday: 15
103
- 9:
104
- - name: Mauritiustag
105
- regions: [ch_ai]
106
- mday: 22
107
- - name: Bruderklausenfest
108
- regions: [ch_ow]
109
- mday: 25
110
- 11:
111
- - name: Allerheiligen
112
- regions: [ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_gl, ch_zg, ch_fr, ch_so, ch_ai, ch_sg, ch_ag, ch_ti, ch_vs, ch_ju]
113
- mday: 1
114
- 12:
115
- - name: Maria Empfängnis
116
- regions: [ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_zg, ch_fr, ch_ai, ch_ag, ch_ti, ch_vs]
117
- mday: 8
118
- # State holiday but observed in all the states
119
- - name: Weihnachten
120
- regions: [ch]
121
- mday: 25
122
- - name: Stefanstag
123
- regions: [ch_zh, ch_be, ch_lu, ch_ur, ch_sz, ch_ow, ch_nw, ch_gl, ch_zg, ch_fr, ch_so, ch_bs, ch_bl, ch_sh, ch_ar, ch_ai, ch_sg, ch_gr, ch_ag, ch_tg, ch_ti, ch_vs, ch_ne]
124
- mday: 26
125
- - name: Restauration de la République
126
- regions: [ch_ge]
127
- mday: 31
128
- methods:
129
- ch_vd_lundi_du_jeune_federal:
130
- # Monday after the third Sunday of September
131
- arguments: year
132
- source: |
133
- date = Date.civil(year,9,1)
134
- # Find the first Sunday of September
135
- until date.wday.eql? 0 do
136
- date += 1
137
- end
138
- # There are 15 days between the first Sunday
139
- # and the Monday after the third Sunday
140
- date + 15
141
- ch_ge_jeune_genevois:
142
- # Thursday after the first Sunday of September
143
- arguments: year
144
- source: |
145
- date = Date.civil(year,9,1)
146
- # Find the first Sunday of September
147
- until date.wday.eql? 0 do
148
- date += 1
149
- end
150
- # Thursday is four days after Sunday
151
- date + 4
152
- ch_gl_naefelser_fahrt:
153
- # First Thursday of April. If the first Thursday of April is in the week before easter, then a week later.
154
- arguments: year
155
- source: |
156
- date = Date.civil(year,4,1)
157
- # Find the first Thursday of April
158
- until date.wday.eql? 4 do
159
- date += 1
160
- end
161
-
162
- if date.eql?(Holidays::Factory::DateCalculator::Easter::Gregorian.easter_calculator.calculate_easter_for(year)-3)
163
- date += 7
164
- end
165
- date
166
- tests: |
167
- { Date.civil(2012,8,1) => 'Bundesfeiertag',
168
- Date.civil(2012,12,25) => 'Weihnachten',
169
- Date.civil(2012,05,17) => 'Auffahrt'
170
- }.each do |date, name|
171
- assert_equal name, (Holidays.on(date, :ch)[0] || {})[:name]
172
- end
173
-
174
- { Date.civil(2012,8,1) => 'Bundesfeiertag',
175
- Date.civil(2012,12,25) => 'Weihnachten',
176
- Date.civil(2012,05,17) => 'Auffahrt',
177
- Date.civil(2012,5,1) => 'Tag der Arbeit',
178
- Date.civil(2012,12,26) => 'Stefanstag'
179
- }.each do |date, name|
180
- assert_equal name, (Holidays.on(date, :ch_zh)[0] || {})[:name]
181
- end
182
-
183
- [Date.civil(2012,9,17), Date.civil(2013,9,16), Date.civil(2014,9,22)].each do |date|
184
- assert_equal 'Lundi du Jeûne fédéral', (Holidays.on(date, :ch_vd)[0] || {})[:name]
185
- end
186
-
187
- [Date.civil(2012,9,6), Date.civil(2013,9,5), Date.civil(2014,9,11)].each do |date|
188
- assert_equal 'Jeûne genevois', (Holidays.on(date, :ch_ge)[0] || {})[:name]
189
- end
190
-
191
- [Date.civil(2012,4,12), Date.civil(2013,4,4), Date.civil(2014,4,3)].each do |date|
192
- assert_equal 'Näfelser Fahrt', (Holidays.on(date, :ch_gl)[0] || {})[:name]
193
- end
@@ -1,94 +0,0 @@
1
- # Chilean holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2014-10-08
4
- #
5
- # Sources:
6
- # - http://www.feriados.cl
7
- #
8
- ---
9
- months:
10
- 0:
11
- - name: Viernes Santo
12
- regions: [cl]
13
- function: easter(year)
14
- function_modifier: -2
15
- - name: Sábado Santo
16
- regions: [cl]
17
- function: easter(year)
18
- function_modifier: -1
19
- 1:
20
- - name: Año Nuevo
21
- regions: [cl]
22
- mday: 1
23
- 5:
24
- - name: Día del Trabajo
25
- regions: [cl]
26
- mday: 1
27
- - name: Día de las Glorias Navales
28
- regions: [cl]
29
- mday: 21
30
- 6:
31
- - name: San Pedro y San Pablo
32
- regions: [cl]
33
- mday: 29
34
- 7:
35
- - name: Día de la Virgen del Carmen
36
- regions: [cl]
37
- mday: 16
38
- 8:
39
- - name: Asunción de la Virgen
40
- regions: [cl]
41
- mday: 15
42
- 9:
43
- - name: Independencia Nacional
44
- regions: [cl]
45
- mday: 18
46
- - name: Día de las Glorias del Ejército
47
- regions: [cl]
48
- mday: 19
49
- 10:
50
- - name: Encuentro de Dos Mundos
51
- regions: [cl]
52
- mday: 12
53
- - name: Día de las Iglesias Evangélicas y Protestantes
54
- regions: [cl]
55
- mday: 31
56
- 11:
57
- - name: Día de Todos los Santos
58
- regions: [cl]
59
- mday: 1
60
- 12:
61
- - name: Inmaculada Concepción de María
62
- regions: [cl]
63
- mday: 8
64
- - name: Navidad
65
- regions: [cl]
66
- mday: 25
67
- tests: |
68
- {Date.civil(2014,1,1) => 'Año Nuevo',
69
- Date.civil(2011,4,22) => 'Viernes Santo',
70
- Date.civil(2011,4,23) => 'Sábado Santo',
71
- Date.civil(2012,4,6) => 'Viernes Santo',
72
- Date.civil(2012,4,7) => 'Sábado Santo',
73
- Date.civil(2013,3,29) => 'Viernes Santo',
74
- Date.civil(2013,3,30) => 'Sábado Santo',
75
- Date.civil(2014,4,18) => 'Viernes Santo',
76
- Date.civil(2014,4,19) => 'Sábado Santo',
77
- Date.civil(2015,4,3) => 'Viernes Santo',
78
- Date.civil(2015,4,4) => 'Sábado Santo',
79
- Date.civil(2016,3,25) => 'Viernes Santo',
80
- Date.civil(2016,3,26) => 'Sábado Santo',
81
- Date.civil(2014,5,1) => 'Día del Trabajo',
82
- Date.civil(2014,5,21) => "Día de las Glorias Navales",
83
- Date.civil(2014,6,29) => "San Pedro y San Pablo",
84
- Date.civil(2014,7,16) => "Día de la Virgen del Carmen",
85
- Date.civil(2014,8,15) => "Asunción de la Virgen",
86
- Date.civil(2014,9,18) => "Independencia Nacional",
87
- Date.civil(2014,9,19) => "Día de las Glorias del Ejército",
88
- Date.civil(2014,10,12) => "Encuentro de Dos Mundos",
89
- Date.civil(2014,10,31) => "Día de las Iglesias Evangélicas y Protestantes",
90
- Date.civil(2014,11,1) => "Día de Todos los Santos",
91
- Date.civil(2014,12,8) => 'Inmaculada Concepción de María',
92
- Date.civil(2014,12,25) => 'Navidad'}.each do |date, name|
93
- assert_equal name, (Holidays.on(date, :cl, :informal)[0] || {})[:name]
94
- end
@@ -1,65 +0,0 @@
1
- # Costa Rican holiday definitions for the Ruby Holiday gem.
2
- #
3
- #
4
- # Updated: 2014-11-22.
5
- #
6
- # Sources:
7
- # - http://en.wikipedia.org/wiki/Public_holidays_in_Costa_Rica
8
- #
9
- months:
10
- 0:
11
- - name: Jueves Santo
12
- regions: [cr]
13
- function: easter(year)
14
- function_modifier: -3
15
- - name: Viernes Santo
16
- regions: [cr]
17
- function: easter(year)
18
- function_modifier: -2
19
- 1:
20
- - name: Año Nuevo
21
- regions: [cr]
22
- mday: 1
23
- 4:
24
- - name: Día de Juan Santamaría
25
- regions: [cr]
26
- mday: 11
27
- 5:
28
- - name: Día del Trabajador
29
- regions: [cr]
30
- mday: 1
31
- 7:
32
- - name: Día de la Anexión de Guanacaste
33
- regions: [cr]
34
- mday: 25
35
- 8:
36
- - name: Día de la Virgen de los Angeles
37
- regions: [cr]
38
- mday: 2
39
- - name: Día de la Madre
40
- regions: [cr]
41
- mday: 15
42
- 9:
43
- - name: Día de la Independencia
44
- regions: [cr]
45
- mday: 15
46
- 10:
47
- - name: Día de las Culturas
48
- regions: [cr]
49
- mday: 12
50
- 12:
51
- - name: Navidad
52
- regions: [cr]
53
- mday: 25
54
- tests: |
55
- {Date.civil(2015,1,1) => 'Año Nuevo',
56
- Date.civil(2015,4,11) => 'Día de Juan Santamaría',
57
- Date.civil(2015,5,1) => 'Día del Trabajador',
58
- Date.civil(2015,7,25) => 'Día de la Anexión de Guanacaste',
59
- Date.civil(2015,8,2) => 'Día de la Virgen de los Angeles',
60
- Date.civil(2015,8,15) => 'Día de la Madre',
61
- Date.civil(2015,9,15) => 'Día de la Independencia',
62
- Date.civil(2015,10,12) => 'Día de las Culturas',
63
- Date.civil(2016,12,25) => 'Navidad'}.each do |date, name|
64
- assert_equal name, (Holidays.on(date, :cr)[0] || {})[:name]
65
- end
@@ -1,73 +0,0 @@
1
- # Czech holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2016-04-20.
4
- # Sources:
5
- # - http://cs.wikipedia.org/wiki/%C4%8Cesk%C3%BD_st%C3%A1tn%C3%AD_sv%C3%A1tek
6
- # - http://www.mpsv.cz/cs/74
7
- ---
8
- months:
9
- 0:
10
- - name: Velký pátek
11
- regions: [cz]
12
- function: easter(year)
13
- function_modifier: -2
14
- - name: Velikonoční pondělí
15
- regions: [cz]
16
- function: easter(year)
17
- function_modifier: 1
18
- 1:
19
- - name: Den obnovy samostatného českého státu
20
- regions: [cz]
21
- mday: 1
22
- 5:
23
- - name: Svátek práce
24
- regions: [cz]
25
- mday: 1
26
- - name: Den vítězství
27
- regions: [cz]
28
- mday: 8
29
- 7:
30
- - name: Den slovanských věrozvěstů Cyrila a Metoděje
31
- regions: [cz]
32
- mday: 5
33
- - name: Den upálení mistra Jana Husa
34
- regions: [cz]
35
- mday: 6
36
- 9:
37
- - name: Den české státnosti
38
- regions: [cz]
39
- mday: 28
40
- 10:
41
- - name: Den vzniku samostatného československého státu
42
- regions: [cz]
43
- mday: 28
44
- 11:
45
- - name: Den boje za svobodu a demokracii
46
- regions: [cz]
47
- mday: 17
48
- 12:
49
- - name: Štědrý den
50
- regions: [cz]
51
- mday: 24
52
- - name: 1. svátek vánoční
53
- regions: [cz]
54
- mday: 25
55
- - name: 2. svátek vánoční
56
- regions: [cz]
57
- mday: 26
58
- tests: |
59
- {Date.civil(2010,1,1) => 'Den obnovy samostatného českého státu',
60
- Date.civil(2016,3,25) => 'Velký pátek',
61
- Date.civil(2010,4,5) => 'Velikonoční pondělí',
62
- Date.civil(2010,5,1) => 'Svátek práce',
63
- Date.civil(2010,5,8) => 'Den vítězství',
64
- Date.civil(2010,7,5) => 'Den slovanských věrozvěstů Cyrila a Metoděje',
65
- Date.civil(2010,7,6) => 'Den upálení mistra Jana Husa',
66
- Date.civil(2010,9,28) => 'Den české státnosti',
67
- Date.civil(2010,10,28) => 'Den vzniku samostatného československého státu',
68
- Date.civil(2010,11,17) => 'Den boje za svobodu a demokracii',
69
- Date.civil(2010,12,24) => 'Štědrý den',
70
- Date.civil(2010,12,25) => '1. svátek vánoční',
71
- Date.civil(2010,12,26) => '2. svátek vánoční'}.each do |date, name|
72
- assert_equal name, (Holidays.on(date, :cz, :informal)[0] || {})[:name]
73
- end
@@ -1,209 +0,0 @@
1
- # German holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2016-03-16
4
- #
5
- # Changes 2016-03-16:
6
- # - Add Ostersonntag, Pfingstsonntag, Heilig Abend and Silvester as informal holidays.
7
- # - Add Fronleichnam for de_sn_aux, de_th_aux
8
- # - Add Reformationstag as informal holiday for de_bw (it is school free)
9
- # - Add Reformationstag for 2017 (500 years)
10
- # - Correction in test for :de_by_aux
11
- #
12
- # Sources:
13
- # - http://en.wikipedia.org/wiki/Holidays_in_Germany
14
- # - http://www.timeanddate.com/calendar/index.html?country=8
15
- # - http://www.germany.info/relaunch/welcome/travel/holidays.html
16
- ---
17
- months:
18
- 0:
19
- - name: Karfreitag
20
- regions: [de]
21
- function: easter(year)
22
- function_modifier: -2
23
- - name: Ostersonntag
24
- regions: [de]
25
- function: easter(year)
26
- type: informal
27
- - name: Ostermontag
28
- regions: [de]
29
- function: easter(year)
30
- function_modifier: 1
31
- - name: Christi Himmelfahrt
32
- regions: [de]
33
- function: easter(year)
34
- function_modifier: 39
35
- - name: Pfingstsonntag
36
- regions: [de]
37
- function: easter(year)
38
- function_modifier: 49
39
- type: informal
40
- - name: Pfingstmontag
41
- regions: [de]
42
- function: easter(year)
43
- function_modifier: 50
44
- - name: Fronleichnam
45
- regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl]
46
- function: easter(year)
47
- function_modifier: 60
48
- - name: Fronleichnam
49
- regions: [de_sn_aux, de_th_aux]
50
- function: easter(year)
51
- function_modifier: 60
52
- - name: Weiberfastnacht
53
- regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl, de_sn]
54
- function: easter(year)
55
- function_modifier: -52
56
- type: informal
57
- - name: Rosenmontag
58
- regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl, de_sn]
59
- function: easter(year)
60
- function_modifier: -48
61
- type: informal
62
- - name: Aschermittwoch
63
- regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl, de_sn]
64
- function: easter(year)
65
- function_modifier: -46
66
- type: informal
67
- 1:
68
- - name: Neujahrstag
69
- regions: [de]
70
- mday: 1
71
- - name: Heilige Drei Könige
72
- regions: [de_bw, de_by, de_st]
73
- mday: 6
74
- 5:
75
- - name: Tag der Arbeit
76
- regions: [de]
77
- mday: 1
78
- 8:
79
- - name: Mariä Himmelfahrt
80
- regions: [de_by, de_sl]
81
- mday: 15
82
- - name: Friedensfest
83
- regions: [de_by_aux]
84
- mday: 8
85
- 10:
86
- - name: Tag der Deutschen Einheit
87
- regions: [de]
88
- mday: 3
89
- - name: Reformationstag
90
- regions: [de_bb, de_mv, de_sn, de_st, de_th]
91
- mday: 31
92
- - name: Reformationstag
93
- regions: [de_bw]
94
- mday: 31
95
- type: informal
96
- - name: Reformationstag
97
- regions: [de]
98
- mday: 31
99
- year_ranges:
100
- - limited: [2017]
101
- 11:
102
- - name: Allerheiligen
103
- regions: [de_bw, de_by, de_nw, de_rp, de_sl]
104
- mday: 1
105
- - name: Buß- und Bettag
106
- regions: [de_sn]
107
- function: de_buss_und_bettag(year)
108
- 12:
109
- - name: Heilig Abend
110
- regions: [de]
111
- mday: 24
112
- type: informal
113
- - name: 1. Weihnachtstag
114
- regions: [de]
115
- mday: 25
116
- - name: 2. Weihnachtstag
117
- regions: [de]
118
- mday: 26
119
- - name: Silvester
120
- regions: [de]
121
- mday: 31
122
- type: informal
123
-
124
- methods:
125
- de_buss_und_bettag:
126
- # Germany: Wednesday before November 23
127
- arguments: year
128
- source: |
129
- date = Date.civil(year,11,23)
130
- if date.wday > 3
131
- date -= (date.wday - 3)
132
- else
133
- date -= (date.wday + 4)
134
- end
135
- date
136
-
137
- tests: |
138
- {Date.civil(2009,1,1) => 'Neujahrstag',
139
- Date.civil(2009,4,10) => 'Karfreitag',
140
- Date.civil(2009,4,12) => 'Ostersonntag',
141
- Date.civil(2009,4,13) => 'Ostermontag',
142
- Date.civil(2009,5,1) => 'Tag der Arbeit',
143
- Date.civil(2009,5,21) => 'Christi Himmelfahrt',
144
- Date.civil(2009,5,31) => 'Pfingstsonntag',
145
- Date.civil(2009,6,1) => 'Pfingstmontag',
146
- Date.civil(2009,10,3) => 'Tag der Deutschen Einheit',
147
- Date.civil(2009,12,24) => 'Heilig Abend',
148
- Date.civil(2009,12,25) => '1. Weihnachtstag',
149
- Date.civil(2009,12,26) => '2. Weihnachtstag',
150
- Date.civil(2009,12,31) => 'Silvester'}.each do |date, name|
151
- assert_equal name, (Holidays.on(date, :de, :informal)[0] || {})[:name], "Failed on '#{name}' for date '#{date}'"
152
- end
153
-
154
- [:de_bw, :de_by, :de_st, :de_].each do |r|
155
- assert_equal 'Heilige Drei Könige', Holidays.on(Date.civil(2009,1,6), r)[0][:name]
156
- end
157
-
158
- [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_].each do |r|
159
- assert_equal 'Fronleichnam', Holidays.on(Date.civil(2009,6,11), r)[0][:name]
160
- end
161
-
162
- [:de_by, :de_sl, :de_].each do |r|
163
- assert_equal 'Mariä Himmelfahrt', Holidays.on(Date.civil(2009,8,15), r)[0][:name]
164
- end
165
-
166
- [:de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_].each do |r|
167
- assert_equal 'Reformationstag', Holidays.on(Date.civil(2009,10,31), r)[0][:name]
168
- end
169
-
170
- # Free day in schools
171
- [:de_bw].each do |r|
172
- assert_equal 'Reformationstag', Holidays.on(Date.civil(2009,10,31), r, :informal)[0][:name]
173
- end
174
-
175
- # 500 years reformation in 2017
176
- assert_equal 'Reformationstag', Holidays.on(Date.civil(2017,10,31), :de)[0][:name]
177
- assert_equal [], Holidays.on(Date.civil(2016,10,31), :de), "Reformationstag is not a holiday in 2016 in whole Germany"
178
- assert_equal [], Holidays.on(Date.civil(2018,10,31), :de), "Reformationstag is not a holiday in 2018 in whole Germany"
179
-
180
- [:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_].each do |r|
181
- assert_equal 'Allerheiligen', Holidays.on(Date.civil(2009,11,1), r)[0][:name]
182
- end
183
-
184
- [:de_by_aux].each do |r|
185
- assert_equal 'Friedensfest', Holidays.on(Date.civil(2015,8,8),r)[0][:name]
186
- end
187
-
188
- [:de,
189
- :de_bw, :de_by, :de_bb, :de_he, :de_mv,
190
- :de_nw, :de_rp, :de_sl, :de_sn, :de_st, :de_th].each do |r|
191
- assert_equal [], Holidays.on(Date.civil(2015,8,8), r), "Friedensfest is not a holiday in #{r}"
192
- end
193
-
194
- assert_equal [], Holidays.on(Date.civil(2010,5,8), :de), '2010-05-08 is not a holiday in Germany'
195
-
196
- assert_equal [], Holidays.on(Date.civil(2010,8,8), :de), '2010-08-08 is not a holiday in Germany'
197
-
198
- # Repentance Day
199
- assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2004,11,17), :de_sn)[0][:name]
200
- assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2005,11,16), :de_sn)[0][:name]
201
- assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2006,11,22), :de_sn)[0][:name]
202
- assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2009,11,18), :de_sn)[0][:name]
203
-
204
- # Carnival
205
- [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn].each do |r|
206
- assert_equal 'Weiberfastnacht', Holidays.on(Date.civil(2016,2,4),r,:informal)[0][:name]
207
- assert_equal 'Rosenmontag', Holidays.on(Date.civil(2016,2,8),r,:informal)[0][:name]
208
- assert_equal 'Aschermittwoch', Holidays.on(Date.civil(2016,2,10),r,:informal)[0][:name]
209
- end