holidays 3.3.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +44 -0
  3. data/CONTRIBUTING.md +37 -0
  4. data/README.md +16 -25
  5. data/REFERENCES +4 -1
  6. data/Rakefile +38 -8
  7. data/benchmark.rb +8 -0
  8. data/definitions/README.md +187 -8
  9. data/definitions/ar.yaml +2 -1
  10. data/definitions/at.yaml +17 -13
  11. data/definitions/au.yaml +65 -60
  12. data/definitions/be_fr.yaml +14 -10
  13. data/definitions/be_nl.yaml +8 -4
  14. data/definitions/bg.yaml +12 -6
  15. data/definitions/br.yaml +6 -3
  16. data/definitions/ca.yaml +8 -6
  17. data/definitions/ch.yaml +21 -15
  18. data/definitions/cl.yaml +4 -2
  19. data/definitions/cr.yaml +5 -3
  20. data/definitions/cz.yaml +4 -2
  21. data/definitions/de.yaml +25 -14
  22. data/definitions/dk.yaml +26 -17
  23. data/definitions/ecb_target.yaml +4 -2
  24. data/definitions/el.yaml +23 -18
  25. data/definitions/es.yaml +31 -28
  26. data/definitions/federal_reserve.yaml +12 -12
  27. data/definitions/fedex.yaml +6 -6
  28. data/definitions/fi.yaml +26 -25
  29. data/definitions/fr.yaml +8 -4
  30. data/definitions/gb.yaml +9 -7
  31. data/definitions/hr.yaml +8 -6
  32. data/definitions/hu.yaml +8 -6
  33. data/definitions/ie.yaml +17 -16
  34. data/definitions/index.yaml +1 -1
  35. data/definitions/is.yaml +29 -19
  36. data/definitions/it.yaml +10 -9
  37. data/definitions/jp.yaml +92 -44
  38. data/definitions/li.yaml +25 -20
  39. data/definitions/lt.yaml +2 -1
  40. data/definitions/ma.yaml +7 -7
  41. data/definitions/mx.yaml +11 -11
  42. data/definitions/nerc.yaml +6 -6
  43. data/definitions/nl.yaml +22 -18
  44. data/definitions/no.yaml +19 -11
  45. data/definitions/north_america_informal.yaml +6 -6
  46. data/definitions/nyse.yaml +9 -8
  47. data/definitions/nz.yaml +33 -29
  48. data/definitions/ph.yaml +15 -8
  49. data/definitions/pl.yaml +27 -17
  50. data/definitions/pt.yaml +4 -2
  51. data/definitions/ro.yaml +21 -18
  52. data/definitions/se.yaml +24 -18
  53. data/definitions/sg.yaml +10 -9
  54. data/definitions/si.yaml +4 -2
  55. data/definitions/sk.yaml +4 -2
  56. data/definitions/united_nations.yaml +12 -12
  57. data/definitions/ups.yaml +6 -6
  58. data/definitions/us.yaml +12 -11
  59. data/definitions/ve.yaml +8 -4
  60. data/definitions/vi.yaml +6 -6
  61. data/definitions/za.yaml +26 -24
  62. data/holidays.gemspec +3 -1
  63. data/lib/generated_definitions/MANIFEST +1 -1
  64. data/lib/generated_definitions/ar.rb +8 -6
  65. data/lib/generated_definitions/at.rb +11 -9
  66. data/lib/generated_definitions/au.rb +75 -99
  67. data/lib/generated_definitions/be.rb +12 -10
  68. data/lib/generated_definitions/be_fr.rb +12 -10
  69. data/lib/generated_definitions/be_nl.rb +12 -10
  70. data/lib/generated_definitions/bg.rb +14 -13
  71. data/lib/generated_definitions/br.rb +11 -9
  72. data/lib/generated_definitions/ca.rb +20 -20
  73. data/lib/generated_definitions/ch.rb +41 -44
  74. data/lib/generated_definitions/cl.rb +9 -7
  75. data/lib/generated_definitions/cr.rb +9 -7
  76. data/lib/generated_definitions/cz.rb +9 -6
  77. data/lib/generated_definitions/de.rb +25 -25
  78. data/lib/generated_definitions/dk.rb +17 -15
  79. data/lib/generated_definitions/ecb_target.rb +9 -7
  80. data/lib/generated_definitions/el.rb +13 -11
  81. data/lib/generated_definitions/es.rb +35 -33
  82. data/lib/generated_definitions/europe.rb +234 -247
  83. data/lib/generated_definitions/federal_reserve.rb +11 -9
  84. data/lib/generated_definitions/fedex.rb +42 -0
  85. data/lib/generated_definitions/fi.rb +32 -36
  86. data/lib/generated_definitions/fr.rb +12 -10
  87. data/lib/generated_definitions/gb.rb +15 -13
  88. data/lib/generated_definitions/hr.rb +10 -8
  89. data/lib/generated_definitions/hu.rb +9 -7
  90. data/lib/generated_definitions/ie.rb +17 -17
  91. data/lib/generated_definitions/is.rb +26 -26
  92. data/lib/generated_definitions/it.rb +9 -7
  93. data/lib/generated_definitions/jp.rb +112 -89
  94. data/lib/generated_definitions/li.rb +14 -12
  95. data/lib/generated_definitions/lt.rb +9 -7
  96. data/lib/generated_definitions/ma.rb +7 -5
  97. data/lib/generated_definitions/mx.rb +7 -5
  98. data/lib/generated_definitions/nerc.rb +10 -8
  99. data/lib/generated_definitions/nl.rb +15 -13
  100. data/lib/generated_definitions/no.rb +16 -14
  101. data/lib/generated_definitions/north_america.rb +34 -37
  102. data/lib/generated_definitions/nyse.rb +10 -8
  103. data/lib/generated_definitions/nz.rb +40 -40
  104. data/lib/generated_definitions/ph.rb +17 -13
  105. data/lib/generated_definitions/pl.rb +25 -27
  106. data/lib/generated_definitions/pt.rb +10 -8
  107. data/lib/generated_definitions/ro.rb +11 -9
  108. data/lib/generated_definitions/scandinavia.rb +92 -102
  109. data/lib/generated_definitions/se.rb +25 -27
  110. data/lib/generated_definitions/sg.rb +11 -9
  111. data/lib/generated_definitions/si.rb +10 -8
  112. data/lib/generated_definitions/sk.rb +9 -7
  113. data/lib/generated_definitions/united_nations.rb +7 -5
  114. data/lib/generated_definitions/ups.rb +13 -12
  115. data/lib/generated_definitions/us.rb +20 -21
  116. data/lib/generated_definitions/ve.rb +11 -9
  117. data/lib/generated_definitions/vi.rb +7 -5
  118. data/lib/generated_definitions/za.rb +19 -17
  119. data/lib/holidays.rb +20 -83
  120. data/lib/holidays/date_calculator/weekend_modifier.rb +22 -5
  121. data/lib/holidays/definition/context/generator.rb +67 -29
  122. data/lib/holidays/definition/context/merger.rb +8 -8
  123. data/lib/holidays/definition/decorator/custom_method_proc.rb +28 -0
  124. data/lib/holidays/definition/decorator/custom_method_source.rb +30 -0
  125. data/lib/holidays/definition/entity/custom_method.rb +11 -0
  126. data/lib/holidays/definition/parser/custom_method.rb +69 -0
  127. data/lib/holidays/definition/repository/custom_methods.rb +27 -0
  128. data/lib/holidays/definition/repository/holidays_by_month.rb +1 -1
  129. data/lib/holidays/definition/repository/{proc_cache.rb → proc_result_cache.rb} +19 -4
  130. data/lib/holidays/definition/validator/custom_method.rb +31 -0
  131. data/lib/holidays/definition_factory.rb +42 -6
  132. data/lib/holidays/errors.rb +6 -0
  133. data/lib/holidays/load_all_definitions.rb +57 -0
  134. data/lib/holidays/option/context/parse_options.rb +26 -16
  135. data/lib/holidays/option_factory.rb +1 -0
  136. data/lib/holidays/use_case/context/between.rb +41 -14
  137. data/lib/holidays/use_case_factory.rb +2 -1
  138. data/lib/holidays/version.rb +1 -1
  139. data/test/data/test_single_custom_holiday_with_custom_procs.yaml +24 -0
  140. data/test/defs/test_defs_at.rb +1 -1
  141. data/test/defs/test_defs_au.rb +3 -2
  142. data/test/defs/test_defs_cr.rb +1 -0
  143. data/test/defs/test_defs_cz.rb +1 -0
  144. data/test/defs/test_defs_dk.rb +2 -2
  145. data/test/defs/test_defs_el.rb +7 -6
  146. data/test/defs/test_defs_europe.rb +40 -33
  147. data/test/defs/test_defs_fedex.rb +24 -0
  148. data/test/defs/test_defs_fi.rb +4 -3
  149. data/test/defs/test_defs_hr.rb +2 -2
  150. data/test/defs/test_defs_hu.rb +2 -2
  151. data/test/defs/test_defs_is.rb +2 -1
  152. data/test/defs/test_defs_it.rb +2 -1
  153. data/test/defs/test_defs_jp.rb +1 -1
  154. data/test/defs/test_defs_li.rb +1 -1
  155. data/test/defs/test_defs_ma.rb +2 -1
  156. data/test/defs/test_defs_mx.rb +4 -3
  157. data/test/defs/test_defs_nl.rb +7 -6
  158. data/test/defs/test_defs_no.rb +1 -0
  159. data/test/defs/test_defs_north_america.rb +4 -3
  160. data/test/defs/test_defs_nyse.rb +2 -1
  161. data/test/defs/test_defs_pl.rb +1 -0
  162. data/test/defs/test_defs_ro.rb +11 -11
  163. data/test/defs/test_defs_scandinavia.rb +12 -8
  164. data/test/defs/test_defs_se.rb +3 -2
  165. data/test/defs/test_defs_sg.rb +2 -1
  166. data/test/defs/test_defs_vi.rb +1 -1
  167. data/test/defs/test_defs_za.rb +3 -2
  168. data/test/holidays/date_calculator/test_weekend_modifier.rb +11 -0
  169. data/test/holidays/definition/context/test_generator.rb +64 -5
  170. data/test/holidays/definition/context/test_merger.rb +5 -2
  171. data/test/holidays/definition/decorator/test_custom_method_proc.rb +113 -0
  172. data/test/holidays/definition/decorator/test_custom_method_source.rb +96 -0
  173. data/test/holidays/definition/parser/test_custom_method.rb +79 -0
  174. data/test/holidays/definition/repository/test_custom_methods.rb +43 -0
  175. data/test/holidays/definition/repository/test_holidays_by_month.rb +0 -32
  176. data/test/holidays/definition/repository/test_proc_result_cache.rb +84 -0
  177. data/test/holidays/definition/validator/test_custom_method.rb +89 -0
  178. data/test/holidays/option/context/test_parse_options.rb +5 -0
  179. data/test/holidays/test_definition_factory.rb +17 -2
  180. data/test/holidays/use_case/context/test_between.rb +2 -0
  181. data/test/test_all_regions.rb +7 -49
  182. data/test/test_custom_holidays.rb +8 -2
  183. data/test/test_helper.rb +9 -2
  184. data/test/test_holidays.rb +9 -29
  185. metadata +46 -11
  186. data/lib/generated_definitions/fed_ex.rb +0 -41
  187. data/test/holidays/definition/repository/test_proc_cache.rb +0 -29
  188. data/test/test_parse_definitions.rb +0 -30
@@ -10,17 +10,20 @@ months:
10
10
  0:
11
11
  - name: Carnaval # same as Shrove Tuesday
12
12
  regions: [br]
13
- function: easter(year)-47
13
+ function: easter(year)
14
+ function_modifier: -47
14
15
  type: informal
15
16
  - name: Sexta-feira Santa
16
17
  regions: [br]
17
- function: easter(year)-2
18
+ function: easter(year)
19
+ function_modifier: -2
18
20
  - name: Páscoa
19
21
  regions: [br]
20
22
  function: easter(year)
21
23
  - name: Corpus Christi
22
24
  regions: [br]
23
- function: easter(year)+60
25
+ function: easter(year)
26
+ function_modifier: 60
24
27
  1:
25
28
  - name: Dia da Confraternização Universal
26
29
  regions: [br]
@@ -5,13 +5,15 @@ months:
5
5
  0:
6
6
  - name: Good Friday
7
7
  regions: [ca]
8
- function: easter(year)-2
8
+ function: easter(year)
9
+ function_modifier: -2
9
10
  - name: Easter Sunday
10
11
  regions: [ca]
11
12
  function: easter(year)
12
13
  - name: Easter Monday
13
14
  regions: [ca]
14
- function: easter(year)+1
15
+ function: easter(year)
16
+ function_modifier: 1
15
17
  type: informal
16
18
  1:
17
19
  - name: New Year's Day
@@ -70,7 +72,7 @@ months:
70
72
  - name: Canada Day
71
73
  regions: [ca]
72
74
  mday: 1
73
- observed: to_monday_if_sunday
75
+ observed: to_monday_if_sunday(date)
74
76
  - name: Orangemen's Day
75
77
  regions: [ca_nf]
76
78
  mday: 12
@@ -128,9 +130,10 @@ months:
128
130
  regions: [ca]
129
131
  mday: 26
130
132
  methods:
131
- ca_victoria_day: |
133
+ ca_victoria_day:
132
134
  # Monday on or before May 24
133
- def self.ca_victoria_day(year)
135
+ arguments: year
136
+ source: |
134
137
  date = Date.civil(year,5,24)
135
138
  if date.wday > 1
136
139
  date -= (date.wday - 1)
@@ -138,7 +141,6 @@ methods:
138
141
  date -= 6
139
142
  end
140
143
  date
141
- end
142
144
  tests: |
143
145
  {Date.civil(2008,1,1) => 'New Year\'s Day',
144
146
  Date.civil(2008,3,21) => 'Good Friday',
@@ -35,20 +35,25 @@ months:
35
35
  0:
36
36
  - name: Karfreitag
37
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)-2
38
+ function: easter(year)
39
+ function_modifier: -2
39
40
  - name: Ostermontag
40
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]
41
- function: easter(year)+1
42
+ function: easter(year)
43
+ function_modifier: 1
42
44
  # State holiday but observed in all the states
43
45
  - name: Auffahrt
44
46
  regions: [ch]
45
- function: easter(year)+39
47
+ function: easter(year)
48
+ function_modifier: 39
46
49
  - name: Pfingstmontag
47
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]
48
- function: easter(year)+50
51
+ function: easter(year)
52
+ function_modifier: 50
49
53
  - name: Fronleichnam
50
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]
51
- function: easter(year)+60
55
+ function: easter(year)
56
+ function_modifier: 60
52
57
  - name: Lundi du Jeûne fédéral
53
58
  regions: [ch_vd]
54
59
  function: ch_vd_lundi_du_jeune_federal(year)
@@ -121,9 +126,10 @@ months:
121
126
  regions: [ch_ge]
122
127
  mday: 31
123
128
  methods:
124
- ch_vd_lundi_du_jeune_federal: |
129
+ ch_vd_lundi_du_jeune_federal:
125
130
  # Monday after the third Sunday of September
126
- def self.ch_vd_lundi_du_jeune_federal(year)
131
+ arguments: year
132
+ source: |
127
133
  date = Date.civil(year,9,1)
128
134
  # Find the first Sunday of September
129
135
  until date.wday.eql? 0 do
@@ -132,10 +138,10 @@ methods:
132
138
  # There are 15 days between the first Sunday
133
139
  # and the Monday after the third Sunday
134
140
  date + 15
135
- end
136
- ch_ge_jeune_genevois: |
141
+ ch_ge_jeune_genevois:
137
142
  # Thursday after the first Sunday of September
138
- def self.ch_ge_jeune_genevois(year)
143
+ arguments: year
144
+ source: |
139
145
  date = Date.civil(year,9,1)
140
146
  # Find the first Sunday of September
141
147
  until date.wday.eql? 0 do
@@ -143,20 +149,20 @@ methods:
143
149
  end
144
150
  # Thursday is four days after Sunday
145
151
  date + 4
146
- end
147
- ch_gl_naefelser_fahrt: |
152
+ ch_gl_naefelser_fahrt:
148
153
  # First Thursday of April. If the first Thursday of April is in the week before easter, then a week later.
149
- def self.ch_gl_naefelser_fahrt(year)
154
+ arguments: year
155
+ source: |
150
156
  date = Date.civil(year,4,1)
151
157
  # Find the first Thursday of April
152
158
  until date.wday.eql? 4 do
153
159
  date += 1
154
160
  end
155
- if date.eql?(easter(year)-3)
161
+
162
+ if date.eql?(Holidays::DateCalculatorFactory::Easter::Gregorian.easter_calculator.calculate_easter_for(year)-3)
156
163
  date += 7
157
164
  end
158
165
  date
159
- end
160
166
  tests: |
161
167
  { Date.civil(2012,8,1) => 'Bundesfeiertag',
162
168
  Date.civil(2012,12,25) => 'Weihnachten',
@@ -10,10 +10,12 @@ months:
10
10
  0:
11
11
  - name: Viernes Santo
12
12
  regions: [cl]
13
- function: easter(year)-2
13
+ function: easter(year)
14
+ function_modifier: -2
14
15
  - name: Sábado Santo
15
16
  regions: [cl]
16
- function: easter(year)-1
17
+ function: easter(year)
18
+ function_modifier: -1
17
19
  1:
18
20
  - name: Año Nuevo
19
21
  regions: [cl]
@@ -10,10 +10,12 @@ months:
10
10
  0:
11
11
  - name: Jueves Santo
12
12
  regions: [cr]
13
- function: easter(year)-3
13
+ function: easter(year)
14
+ function_modifier: -3
14
15
  - name: Viernes Santo
15
16
  regions: [cr]
16
- function: easter(year)-2
17
+ function: easter(year)
18
+ function_modifier: -2
17
19
  1:
18
20
  - name: Año Nuevo
19
21
  regions: [cr]
@@ -60,4 +62,4 @@ tests: |
60
62
  Date.civil(2015,10,12) => 'Día de las Culturas',
61
63
  Date.civil(2016,12,25) => 'Navidad'}.each do |date, name|
62
64
  assert_equal name, (Holidays.on(date, :cr)[0] || {})[:name]
63
- end
65
+ end
@@ -9,10 +9,12 @@ months:
9
9
  0:
10
10
  - name: Velký pátek
11
11
  regions: [cz]
12
- function: easter(year)-2
12
+ function: easter(year)
13
+ function_modifier: -2
13
14
  - name: Velikonoční pondělí
14
15
  regions: [cz]
15
- function: easter(year)+1
16
+ function: easter(year)
17
+ function_modifier: 1
16
18
  1:
17
19
  - name: Den obnovy samostatného českého státu
18
20
  regions: [cz]
@@ -18,41 +18,51 @@ months:
18
18
  0:
19
19
  - name: Karfreitag
20
20
  regions: [de]
21
- function: easter(year)-2
21
+ function: easter(year)
22
+ function_modifier: -2
22
23
  - name: Ostersonntag
23
24
  regions: [de]
24
25
  function: easter(year)
25
26
  type: informal
26
27
  - name: Ostermontag
27
28
  regions: [de]
28
- function: easter(year)+1
29
+ function: easter(year)
30
+ function_modifier: 1
29
31
  - name: Christi Himmelfahrt
30
32
  regions: [de]
31
- function: easter(year)+39
33
+ function: easter(year)
34
+ function_modifier: 39
32
35
  - name: Pfingstsonntag
33
36
  regions: [de]
34
- function: easter(year)+49
37
+ function: easter(year)
38
+ function_modifier: 49
35
39
  type: informal
36
40
  - name: Pfingstmontag
37
41
  regions: [de]
38
- function: easter(year)+50
42
+ function: easter(year)
43
+ function_modifier: 50
39
44
  - name: Fronleichnam
40
45
  regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl]
41
- function: easter(year)+60
46
+ function: easter(year)
47
+ function_modifier: 60
42
48
  - name: Fronleichnam
43
49
  regions: [de_sn_aux, de_th_aux]
44
- function: easter(year)+60
50
+ function: easter(year)
51
+ function_modifier: 60
45
52
  - name: Weiberfastnacht
46
- regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl, de_sn ]
47
- function: easter(year)-52
53
+ regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl, de_sn]
54
+ function: easter(year)
55
+ function_modifier: -52
48
56
  type: informal
49
57
  - name: Rosenmontag
50
58
  regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl, de_sn]
51
- function: easter(year)-48
59
+ function: easter(year)
60
+ function_modifier: -48
52
61
  type: informal
53
62
  - name: Aschermittwoch
54
63
  regions: [de_bw, de_by, de_he, de_nw, de_rp, de_sl, de_sn]
55
- function: easter(year)-46
64
+ function: easter(year)
65
+ function_modifier: -46
56
66
  type: informal
57
67
  1:
58
68
  - name: Neujahrstag
@@ -110,10 +120,12 @@ months:
110
120
  regions: [de]
111
121
  mday: 31
112
122
  type: informal
123
+
113
124
  methods:
114
- de_buss_und_bettag: |
125
+ de_buss_und_bettag:
115
126
  # Germany: Wednesday before November 23
116
- def self.de_buss_und_bettag(year)
127
+ arguments: year
128
+ source: |
117
129
  date = Date.civil(year,11,23)
118
130
  if date.wday > 3
119
131
  date -= (date.wday - 3)
@@ -121,7 +133,6 @@ methods:
121
133
  date -= (date.wday + 4)
122
134
  end
123
135
  date
124
- end
125
136
 
126
137
  tests: |
127
138
  {Date.civil(2009,1,1) => 'Neujahrstag',
@@ -5,46 +5,55 @@
5
5
  # - http://en.wikipedia.org/wiki/Holidays_in_Denmark
6
6
  # - http://www.amblondon.um.dk/en/menu/AboutDenmark/PublicHolidaysInDK/PublicHolidaysinDenmark-until2010.htm
7
7
  # - http://borger.dk/forside/kirke-og-tro/folkekirken/officielle-helligdage
8
- ---
8
+ ---
9
9
  months:
10
- 0:
10
+ 0:
11
11
  - name: Fastelavn
12
12
  regions: [dk]
13
- function: easter(year)-49
13
+ function: easter(year)
14
+ function_modifier: -49
14
15
  type: informal
15
16
  - name: Palmesøndag
16
17
  regions: [dk]
17
- function: easter(year)-7
18
+ function: easter(year)
19
+ function_modifier: -7
18
20
  type: informal
19
21
  - name: Skærtorsdag
20
22
  regions: [dk]
21
- function: easter(year)-3
23
+ function: easter(year)
24
+ function_modifier: -3
22
25
  - name: Langfredag
23
26
  regions: [dk]
24
- function: easter(year)-2
27
+ function: easter(year)
28
+ function_modifier: -2
25
29
  - name: Påskedag
26
30
  regions: [dk]
27
31
  function: easter(year)
28
32
  - name: 2. påskedag
29
33
  regions: [dk]
30
- function: easter(year)+1
34
+ function: easter(year)
35
+ function_modifier: 1
31
36
  - name: Store Bededag
32
37
  regions: [dk]
33
- function: easter(year)+26
38
+ function: easter(year)
39
+ function_modifier: 26
34
40
  - name: Kristi Himmelfartsdag
35
41
  regions: [dk]
36
- function: easter(year)+39
42
+ function: easter(year)
43
+ function_modifier: 39
37
44
  - name: Pinsedag
38
45
  regions: [dk]
39
- function: easter(year)+49
46
+ function: easter(year)
47
+ function_modifier: 49
40
48
  - name: 2. Pinsedag
41
49
  regions: [dk]
42
- function: easter(year)+50
43
- 1:
50
+ function: easter(year)
51
+ function_modifier: 50
52
+ 1:
44
53
  - name: Nytårsdag
45
54
  regions: [dk]
46
55
  mday: 1
47
- 4:
56
+ 4:
48
57
  - name: 1. april
49
58
  regions: [dk]
50
59
  mday: 1
@@ -79,12 +88,12 @@ months:
79
88
  regions: [dk]
80
89
  mday: 23
81
90
  type: informal
82
- 11:
91
+ 11:
83
92
  - name: Mortensaften
84
93
  regions: [dk]
85
94
  mday: 10
86
95
  type: informal
87
- 12:
96
+ 12:
88
97
  - name: Sankt Lucia
89
98
  regions: [dk]
90
99
  mday: 13
@@ -100,8 +109,8 @@ months:
100
109
  regions: [dk]
101
110
  mday: 26
102
111
  tests: |
103
- {Date.civil(2007,1,1) => 'Nytårsdag',
104
- Date.civil(2007,2,18) => 'Fastelavn',
112
+ {Date.civil(2007,1,1) => 'Nytårsdag',
113
+ Date.civil(2007,2,18) => 'Fastelavn',
105
114
  Date.civil(2007,4,9) => 'Danmarks besættelse',
106
115
  Date.civil(2007,4,16) => 'Dronningens fødselsdag',
107
116
  Date.civil(2007,4,5) => 'Skærtorsdag',
@@ -9,10 +9,12 @@ months:
9
9
  0:
10
10
  - name: Good Friday
11
11
  regions: [ecb_target]
12
- function: easter(year)-2
12
+ function: easter(year)
13
+ function_modifier: -2
13
14
  - name: Easter Monday
14
15
  regions: [ecb_target]
15
- function: easter(year)+1
16
+ function: easter(year)
17
+ function_modifier: 1
16
18
  1:
17
19
  - name: New Year's Day
18
20
  regions: [ecb_target]
@@ -8,28 +8,33 @@
8
8
  # http://5dspace-time.org/Calendar/Algorithm.html - for offsets
9
9
  # http://el.wikipedia.org/wiki/Επίσημες_αργίες_στην_Ελλάδα - for holidays
10
10
  # http://www.eortologio.gr/arthra/pasxa.php - for holidays
11
- ---
11
+ ---
12
12
  months:
13
- 0:
13
+ 0:
14
14
  - name: Μεγάλη Παρασκευή
15
15
  regions: [el]
16
- function: orthodox_easter(year)-2
16
+ function: orthodox_easter(year)
17
+ function_modifier: -2
17
18
  - name: Μεγάλο Σάββατο
18
19
  regions: [el]
19
- function: orthodox_easter(year)-1
20
+ function: orthodox_easter(year)
21
+ function_modifier: -1
20
22
  - name: Κυριακή του Πάσχα
21
23
  regions: [el]
22
24
  function: orthodox_easter(year)
23
25
  - name: Δευτέρα του Πάσχα
24
26
  regions: [el]
25
- function: orthodox_easter(year)+1
27
+ function: orthodox_easter(year)
28
+ function_modifier: 1
26
29
  - name: Καθαρά Δευτέρα
27
30
  regions: [el]
28
- function: orthodox_easter(year)-48
31
+ function: orthodox_easter(year)
32
+ function_modifier: -48
29
33
  - name: Αγίου Πνεύματος
30
34
  regions: [el]
31
- function: orthodox_easter(year)+50
32
- 1:
35
+ function: orthodox_easter(year)
36
+ function_modifier: 50
37
+ 1:
33
38
  - name: Πρωτοχρονιά
34
39
  regions: [el]
35
40
  mday: 1
@@ -44,15 +49,15 @@ months:
44
49
  - name: Πρωτομαγιά
45
50
  regions: [el]
46
51
  mday: 1
47
- 8:
52
+ 8:
48
53
  - name: Κοίμηση της Θεοτόκου
49
54
  regions: [el]
50
55
  mday: 15
51
56
  10:
52
57
  - name: Επέτειος του Όχι
53
58
  regions: [el]
54
- mday: 28
55
- 12:
59
+ mday: 28
60
+ 12:
56
61
  - name: Χριστούγεννα
57
62
  regions: [el]
58
63
  mday: 25
@@ -60,13 +65,13 @@ months:
60
65
  regions: [el]
61
66
  mday: 26
62
67
  tests: |
63
- {Date.civil(2011,1,1) => 'Πρωτοχρονιά',
68
+ {Date.civil(2011,1,1) => 'Πρωτοχρονιά',
64
69
  Date.civil(2011,1,6) => 'Θεοφάνεια',
65
- Date.civil(2011,4,22) => 'Μεγάλη Παρασκευή',
66
- Date.civil(1970,4,25) => 'Μεγάλο Σάββατο',
67
- Date.civil(1985,4,14) => 'Κυριακή του Πάσχα',
68
- Date.civil(2011,4,24) => 'Κυριακή του Πάσχα',
69
- Date.civil(2027,5,2) => 'Κυριακή του Πάσχα',
70
+ Date.civil(2011,4,22) => 'Μεγάλη Παρασκευή',
71
+ Date.civil(1970,4,25) => 'Μεγάλο Σάββατο',
72
+ Date.civil(1985,4,14) => 'Κυριακή του Πάσχα',
73
+ Date.civil(2011,4,24) => 'Κυριακή του Πάσχα',
74
+ Date.civil(2027,5,2) => 'Κυριακή του Πάσχα',
70
75
  Date.civil(2046,4,30) => 'Δευτέρα του Πάσχα',
71
76
  Date.civil(2011,5,1) => 'Πρωτομαγιά',
72
77
  Date.civil(2011,6,13) => 'Αγίου Πνεύματος',
@@ -76,4 +81,4 @@ tests: |
76
81
  Date.civil(2011,12,25) => 'Χριστούγεννα',
77
82
  Date.civil(2011,12,26) => 'Δεύτερη ημέρα των Χριστουγέννων'}.each do |date, name|
78
83
  assert_equal name, (Holidays.on(date, :el, :informal)[0] || {})[:name]
79
- end
84
+ end