holidays 4.2.0 → 8.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (330) hide show
  1. checksums.yaml +5 -5
  2. data/.gitmodules +3 -0
  3. data/CHANGELOG.md +195 -0
  4. data/Makefile +45 -0
  5. data/README.md +253 -77
  6. data/Rakefile +10 -11
  7. data/bin/console +0 -0
  8. data/bin/setup +1 -0
  9. data/doc/CONTRIBUTING.md +72 -0
  10. data/doc/MAINTAINERS.md +81 -0
  11. data/{REFERENCES → doc/REFERENCES} +0 -0
  12. data/holidays.gemspec +9 -9
  13. data/lib/generated_definitions/MANIFEST +26 -4
  14. data/lib/generated_definitions/REGIONS.rb +3 -1
  15. data/lib/generated_definitions/ar.rb +4 -10
  16. data/lib/generated_definitions/at.rb +3 -9
  17. data/lib/generated_definitions/au.rb +32 -25
  18. data/lib/generated_definitions/be_fr.rb +2 -8
  19. data/lib/generated_definitions/be_nl.rb +2 -8
  20. data/lib/generated_definitions/bg.rb +2 -8
  21. data/lib/generated_definitions/br.rb +2 -8
  22. data/lib/generated_definitions/ca.rb +33 -32
  23. data/lib/generated_definitions/ch.rb +17 -11
  24. data/lib/generated_definitions/cl.rb +38 -12
  25. data/lib/generated_definitions/co.rb +121 -0
  26. data/lib/generated_definitions/cr.rb +2 -8
  27. data/lib/generated_definitions/cz.rb +2 -8
  28. data/lib/generated_definitions/de.rb +11 -14
  29. data/lib/generated_definitions/dk.rb +2 -8
  30. data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -16
  31. data/lib/generated_definitions/ee.rb +36 -0
  32. data/lib/generated_definitions/el.rb +2 -8
  33. data/lib/generated_definitions/es.rb +8 -11
  34. data/lib/generated_definitions/europe.rb +121 -51
  35. data/lib/generated_definitions/federalreserve.rb +34 -0
  36. data/lib/generated_definitions/{federal_reserve.rb → federalreservebanks.rb} +14 -20
  37. data/lib/generated_definitions/fedex.rb +3 -9
  38. data/lib/generated_definitions/fi.rb +2 -8
  39. data/lib/generated_definitions/fr.rb +6 -10
  40. data/lib/generated_definitions/gb.rb +12 -16
  41. data/lib/generated_definitions/ge.rb +41 -0
  42. data/lib/generated_definitions/hk.rb +106 -0
  43. data/lib/generated_definitions/hr.rb +10 -14
  44. data/lib/generated_definitions/hu.rb +4 -9
  45. data/lib/generated_definitions/ie.rb +3 -17
  46. data/lib/generated_definitions/is.rb +3 -9
  47. data/lib/generated_definitions/it.rb +16 -13
  48. data/lib/generated_definitions/jp.rb +47 -36
  49. data/lib/generated_definitions/kr.rb +40 -0
  50. data/lib/generated_definitions/kz.rb +38 -0
  51. data/lib/generated_definitions/li.rb +2 -8
  52. data/lib/generated_definitions/lt.rb +2 -8
  53. data/lib/generated_definitions/lu.rb +35 -0
  54. data/lib/generated_definitions/lv.rb +52 -0
  55. data/lib/generated_definitions/ma.rb +2 -8
  56. data/lib/generated_definitions/mt_en.rb +38 -0
  57. data/lib/generated_definitions/mt_mt.rb +38 -0
  58. data/lib/generated_definitions/mx.rb +6 -12
  59. data/lib/generated_definitions/my.rb +30 -0
  60. data/lib/generated_definitions/nerc.rb +2 -8
  61. data/lib/generated_definitions/ng.rb +33 -0
  62. data/lib/generated_definitions/nl.rb +2 -8
  63. data/lib/generated_definitions/no.rb +2 -8
  64. data/lib/generated_definitions/northamerica.rb +223 -0
  65. data/lib/generated_definitions/nyse.rb +3 -9
  66. data/lib/generated_definitions/nz.rb +2 -9
  67. data/lib/generated_definitions/pe.rb +43 -0
  68. data/lib/generated_definitions/ph.rb +4 -10
  69. data/lib/generated_definitions/pl.rb +2 -8
  70. data/lib/generated_definitions/pt.rb +12 -12
  71. data/lib/generated_definitions/ro.rb +6 -9
  72. data/lib/generated_definitions/rs_cyrl.rb +39 -0
  73. data/lib/generated_definitions/rs_la.rb +39 -0
  74. data/lib/generated_definitions/ru.rb +37 -0
  75. data/lib/generated_definitions/scandinavia.rb +3 -9
  76. data/lib/generated_definitions/se.rb +2 -8
  77. data/lib/generated_definitions/sg.rb +2 -8
  78. data/lib/generated_definitions/si.rb +2 -8
  79. data/lib/generated_definitions/sk.rb +2 -8
  80. data/lib/generated_definitions/southamerica.rb +228 -0
  81. data/lib/generated_definitions/th.rb +36 -0
  82. data/lib/generated_definitions/tn.rb +32 -0
  83. data/lib/generated_definitions/tr.rb +64 -0
  84. data/lib/generated_definitions/ua.rb +37 -0
  85. data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -67
  86. data/lib/generated_definitions/ups.rb +3 -9
  87. data/lib/generated_definitions/us.rb +113 -23
  88. data/lib/generated_definitions/ve.rb +2 -8
  89. data/lib/generated_definitions/vi.rb +6 -11
  90. data/lib/generated_definitions/za.rb +2 -8
  91. data/lib/holidays/core_extensions/date.rb +21 -3
  92. data/lib/holidays/core_extensions/time.rb +23 -0
  93. data/lib/holidays/date_calculator/day_of_month.rb +3 -3
  94. data/lib/holidays/date_calculator/lunar_date.rb +371 -0
  95. data/lib/holidays/date_calculator/weekend_modifier.rb +0 -7
  96. data/lib/holidays/definition/context/function_processor.rb +91 -0
  97. data/lib/holidays/definition/context/generator.rb +37 -96
  98. data/lib/holidays/definition/context/load.rb +29 -0
  99. data/lib/holidays/definition/context/merger.rb +0 -4
  100. data/lib/holidays/definition/decorator/test.rb +37 -0
  101. data/lib/holidays/definition/entity/test.rb +11 -0
  102. data/lib/holidays/definition/generator/module.rb +54 -0
  103. data/lib/holidays/definition/generator/regions.rb +55 -0
  104. data/lib/holidays/definition/generator/test.rb +51 -0
  105. data/lib/holidays/definition/parser/custom_method.rb +3 -5
  106. data/lib/holidays/definition/parser/test.rb +86 -0
  107. data/lib/holidays/definition/repository/cache.rb +23 -9
  108. data/lib/holidays/definition/repository/holidays_by_month.rb +10 -2
  109. data/lib/holidays/definition/repository/proc_result_cache.rb +1 -1
  110. data/lib/holidays/definition/repository/regions.rb +23 -13
  111. data/lib/holidays/definition/validator/custom_method.rb +1 -1
  112. data/lib/holidays/definition/validator/region.rb +2 -11
  113. data/lib/holidays/definition/validator/test.rb +71 -0
  114. data/lib/holidays/errors.rb +5 -0
  115. data/lib/holidays/factory/date_calculator.rb +42 -0
  116. data/lib/holidays/factory/definition.rb +143 -0
  117. data/lib/holidays/factory/finder.rb +70 -0
  118. data/lib/holidays/finder/context/between.rb +45 -0
  119. data/lib/holidays/{use_case → finder}/context/dates_driver_builder.rb +11 -15
  120. data/lib/holidays/finder/context/next_holiday.rb +57 -0
  121. data/lib/holidays/finder/context/parse_options.rb +104 -0
  122. data/lib/holidays/finder/context/search.rb +110 -0
  123. data/lib/holidays/finder/context/year_holiday.rb +57 -0
  124. data/lib/holidays/finder/rules/in_region.rb +31 -0
  125. data/lib/holidays/finder/rules/year_range.rb +58 -0
  126. data/lib/holidays/load_all_definitions.rb +16 -17
  127. data/lib/holidays/version.rb +1 -1
  128. data/lib/holidays.rb +50 -125
  129. data/test/coverage_report.rb +26 -0
  130. data/test/data/test_custom_informal_holidays_defs.yaml +11 -0
  131. data/test/data/test_custom_year_range_holiday_defs.yaml +13 -10
  132. data/test/data/test_invalid_region.rb +15 -0
  133. data/test/data/test_multiple_custom_holiday_defs.yaml +7 -4
  134. data/test/data/test_multiple_regions_with_conflicts_region_1.yaml +38 -0
  135. data/test/data/test_multiple_regions_with_conflicts_region_2.yaml +38 -0
  136. data/test/data/test_region.rb +15 -0
  137. data/test/data/test_single_custom_holiday_defs.yaml +7 -4
  138. data/test/data/test_single_custom_holiday_with_custom_procs.yaml +11 -7
  139. data/test/defs/test_defs_ar.rb +41 -19
  140. data/test/defs/test_defs_at.rb +18 -11
  141. data/test/defs/test_defs_au.rb +185 -126
  142. data/test/defs/test_defs_be_fr.rb +33 -14
  143. data/test/defs/test_defs_be_nl.rb +33 -14
  144. data/test/defs/test_defs_bg.rb +29 -17
  145. data/test/defs/test_defs_br.rb +33 -19
  146. data/test/defs/test_defs_ca.rb +246 -136
  147. data/test/defs/test_defs_ch.rb +35 -23
  148. data/test/defs/test_defs_cl.rb +57 -27
  149. data/test/defs/test_defs_co.rb +113 -0
  150. data/test/defs/test_defs_cr.rb +17 -11
  151. data/test/defs/test_defs_cz.rb +25 -15
  152. data/test/defs/test_defs_de.rb +60 -59
  153. data/test/defs/test_defs_dk.rb +31 -19
  154. data/test/defs/test_defs_ecbtarget.rb +27 -0
  155. data/test/defs/test_defs_ee.rb +41 -0
  156. data/test/defs/test_defs_el.rb +29 -17
  157. data/test/defs/test_defs_es.rb +116 -52
  158. data/test/defs/test_defs_europe.rb +1382 -701
  159. data/test/defs/test_defs_federalreserve.rb +113 -0
  160. data/test/defs/test_defs_federalreservebanks.rb +247 -0
  161. data/test/defs/test_defs_fedex.rb +19 -12
  162. data/test/defs/test_defs_fi.rb +47 -27
  163. data/test/defs/test_defs_fr.rb +31 -18
  164. data/test/defs/test_defs_gb.rb +120 -51
  165. data/test/defs/test_defs_ge.rb +53 -0
  166. data/test/defs/test_defs_hk.rb +59 -0
  167. data/test/defs/test_defs_hr.rb +32 -18
  168. data/test/defs/test_defs_hu.rb +34 -16
  169. data/test/defs/test_defs_ie.rb +41 -25
  170. data/test/defs/test_defs_is.rb +39 -22
  171. data/test/defs/test_defs_it.rb +43 -14
  172. data/test/defs/test_defs_jp.rb +141 -55
  173. data/test/defs/test_defs_kr.rb +37 -0
  174. data/test/defs/test_defs_kz.rb +39 -0
  175. data/test/defs/test_defs_li.rb +20 -20
  176. data/test/defs/test_defs_lt.rb +51 -30
  177. data/test/defs/test_defs_lu.rb +35 -0
  178. data/test/defs/test_defs_lv.rb +90 -0
  179. data/test/defs/test_defs_ma.rb +17 -11
  180. data/test/defs/test_defs_mt_en.rb +41 -0
  181. data/test/defs/test_defs_mt_mt.rb +41 -0
  182. data/test/defs/test_defs_mx.rb +34 -23
  183. data/test/defs/test_defs_my.rb +23 -0
  184. data/test/defs/test_defs_nerc.rb +17 -11
  185. data/test/defs/test_defs_ng.rb +29 -0
  186. data/test/defs/test_defs_nl.rb +21 -13
  187. data/test/defs/test_defs_no.rb +31 -18
  188. data/test/defs/test_defs_northamerica.rb +644 -0
  189. data/test/defs/test_defs_nyse.rb +27 -11
  190. data/test/defs/test_defs_nz.rb +47 -28
  191. data/test/defs/test_defs_pe.rb +47 -0
  192. data/test/defs/test_defs_ph.rb +17 -13
  193. data/test/defs/test_defs_pl.rb +200 -119
  194. data/test/defs/test_defs_pt.rb +35 -15
  195. data/test/defs/test_defs_ro.rb +53 -24
  196. data/test/defs/test_defs_rs_cyrl.rb +46 -0
  197. data/test/defs/test_defs_rs_la.rb +46 -0
  198. data/test/defs/test_defs_ru.rb +34 -0
  199. data/test/defs/test_defs_scandinavia.rb +193 -116
  200. data/test/defs/test_defs_se.rb +47 -28
  201. data/test/defs/test_defs_sg.rb +13 -9
  202. data/test/defs/test_defs_si.rb +93 -24
  203. data/test/defs/test_defs_sk.rb +29 -17
  204. data/test/defs/test_defs_southamerica.rb +307 -0
  205. data/test/defs/test_defs_th.rb +33 -0
  206. data/test/defs/test_defs_tn.rb +27 -0
  207. data/test/defs/test_defs_tr.rb +60 -0
  208. data/test/defs/test_defs_ua.rb +41 -0
  209. data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -4
  210. data/test/defs/test_defs_ups.rb +19 -12
  211. data/test/defs/test_defs_us.rb +370 -30
  212. data/test/defs/test_defs_ve.rb +23 -16
  213. data/test/defs/test_defs_vi.rb +10 -6
  214. data/test/defs/test_defs_za.rb +23 -14
  215. data/test/holidays/core_extensions/test_date.rb +3 -2
  216. data/test/holidays/core_extensions/test_date_time.rb +60 -0
  217. data/test/holidays/date_calculator/test_lunar_date.rb +89 -0
  218. data/test/holidays/definition/context/test_function_processor.rb +199 -0
  219. data/test/holidays/definition/context/test_generator.rb +66 -35
  220. data/test/holidays/definition/context/test_load.rb +37 -0
  221. data/test/holidays/definition/decorator/test_test.rb +123 -0
  222. data/test/holidays/definition/generator/test_module.rb +268 -0
  223. data/test/holidays/definition/generator/test_regions.rb +97 -0
  224. data/test/holidays/definition/generator/test_test.rb +113 -0
  225. data/test/holidays/definition/parser/test_custom_method.rb +6 -6
  226. data/test/holidays/definition/parser/test_test.rb +142 -0
  227. data/test/holidays/definition/repository/test_cache.rb +47 -6
  228. data/test/holidays/definition/repository/test_holidays_by_month.rb +121 -1
  229. data/test/holidays/definition/repository/test_proc_result_cache.rb +8 -1
  230. data/test/holidays/definition/repository/test_regions.rb +31 -13
  231. data/test/holidays/definition/validator/test_custom_method.rb +5 -0
  232. data/test/holidays/definition/validator/test_region.rb +16 -12
  233. data/test/holidays/definition/validator/test_test.rb +60 -0
  234. data/test/holidays/finder/context/test_between.rb +172 -0
  235. data/test/holidays/{use_case → finder}/context/test_dates_driver_builder.rb +2 -2
  236. data/test/holidays/finder/context/test_next_holiday.rb +156 -0
  237. data/test/holidays/finder/context/test_parse_options.rb +141 -0
  238. data/test/holidays/finder/context/test_search.rb +232 -0
  239. data/test/holidays/finder/context/test_year_holiday.rb +202 -0
  240. data/test/holidays/finder/rules/test_in_region.rb +42 -0
  241. data/test/holidays/finder/rules/test_year_range.rb +166 -0
  242. data/test/integration/README.md +9 -0
  243. data/test/{test_all_regions.rb → integration/test_all_regions.rb} +18 -4
  244. data/test/integration/test_any_holidays_during_work_week.rb +90 -0
  245. data/test/integration/test_available_regions.rb +23 -0
  246. data/test/{test_custom_holidays.rb → integration/test_custom_holidays.rb} +6 -6
  247. data/test/integration/test_custom_informal_holidays.rb +15 -0
  248. data/test/{test_custom_year_range_holidays.rb → integration/test_custom_year_range_holidays.rb} +1 -9
  249. data/test/{test_holidays.rb → integration/test_holidays.rb} +100 -69
  250. data/test/{test_holidays_between.rb → integration/test_holidays_between.rb} +19 -17
  251. data/test/integration/test_multiple_regions.rb +71 -0
  252. data/test/integration/test_multiple_regions_with_conflict.rb +29 -0
  253. data/test/integration/test_nonstandard_regions.rb +25 -0
  254. data/test/test_helper.rb +7 -3
  255. metadata +204 -132
  256. data/CONTRIBUTING.md +0 -41
  257. data/benchmark.rb +0 -8
  258. data/definitions/README.md +0 -353
  259. data/definitions/ar.yaml +0 -93
  260. data/definitions/at.yaml +0 -72
  261. data/definitions/au.yaml +0 -375
  262. data/definitions/be_fr.yaml +0 -69
  263. data/definitions/be_nl.yaml +0 -69
  264. data/definitions/bg.yaml +0 -127
  265. data/definitions/br.yaml +0 -77
  266. data/definitions/ca.yaml +0 -302
  267. data/definitions/ch.yaml +0 -193
  268. data/definitions/cl.yaml +0 -94
  269. data/definitions/cr.yaml +0 -65
  270. data/definitions/cz.yaml +0 -73
  271. data/definitions/de.yaml +0 -209
  272. data/definitions/dk.yaml +0 -130
  273. data/definitions/ecb_target.yaml +0 -44
  274. data/definitions/el.yaml +0 -84
  275. data/definitions/es.yaml +0 -203
  276. data/definitions/federal_reserve.yaml +0 -114
  277. data/definitions/fedex.yaml +0 -62
  278. data/definitions/fi.yaml +0 -115
  279. data/definitions/fr.yaml +0 -79
  280. data/definitions/gb.yaml +0 -151
  281. data/definitions/hr.yaml +0 -79
  282. data/definitions/hu.yaml +0 -63
  283. data/definitions/ie.yaml +0 -89
  284. data/definitions/index.yaml +0 -57
  285. data/definitions/is.yaml +0 -146
  286. data/definitions/it.yaml +0 -67
  287. data/definitions/jp.yaml +0 -316
  288. data/definitions/li.yaml +0 -107
  289. data/definitions/lt.yaml +0 -89
  290. data/definitions/ma.yaml +0 -52
  291. data/definitions/mx.yaml +0 -106
  292. data/definitions/nerc.yaml +0 -51
  293. data/definitions/nl.yaml +0 -73
  294. data/definitions/no.yaml +0 -90
  295. data/definitions/north_america_informal.yaml +0 -61
  296. data/definitions/nyse.yaml +0 -64
  297. data/definitions/nz.yaml +0 -163
  298. data/definitions/ph.yaml +0 -94
  299. data/definitions/pl.yaml +0 -320
  300. data/definitions/pt.yaml +0 -69
  301. data/definitions/ro.yaml +0 -78
  302. data/definitions/se.yaml +0 -120
  303. data/definitions/sg.yaml +0 -56
  304. data/definitions/si.yaml +0 -86
  305. data/definitions/sk.yaml +0 -80
  306. data/definitions/united_nations.yaml +0 -189
  307. data/definitions/ups.yaml +0 -62
  308. data/definitions/us.yaml +0 -103
  309. data/definitions/ve.yaml +0 -74
  310. data/definitions/vi.yaml +0 -29
  311. data/definitions/za.yaml +0 -80
  312. data/lib/generated_definitions/north_america.rb +0 -126
  313. data/lib/holidays/date_calculator_factory.rb +0 -35
  314. data/lib/holidays/definition_factory.rb +0 -86
  315. data/lib/holidays/option/context/parse_options.rb +0 -106
  316. data/lib/holidays/option_factory.rb +0 -15
  317. data/lib/holidays/use_case/context/between.rb +0 -45
  318. data/lib/holidays/use_case/context/context_common.rb +0 -123
  319. data/lib/holidays/use_case/context/next_holiday.rb +0 -54
  320. data/lib/holidays/use_case_factory.rb +0 -31
  321. data/test/defs/test_defs_ecb_target.rb +0 -23
  322. data/test/defs/test_defs_federal_reserve.rb +0 -69
  323. data/test/defs/test_defs_north_america.rb +0 -195
  324. data/test/holidays/option/context/test_parse_options.rb +0 -74
  325. data/test/holidays/test_date_calculator_factory.rb +0 -27
  326. data/test/holidays/test_definition_factory.rb +0 -49
  327. data/test/holidays/test_option_factory.rb +0 -9
  328. data/test/holidays/test_use_case_factory.rb +0 -13
  329. data/test/holidays/use_case/context/test_between.rb +0 -77
  330. data/test/test_multiple_regions.rb +0 -24
data/definitions/au.yaml DELETED
@@ -1,375 +0,0 @@
1
- # Australian holiday definitions for the Ruby Holiday gem.
2
- # Updated: 2008-11-29.
3
- # Sources:
4
- # - http://en.wikipedia.org/wiki/Australian_public_holidays
5
- # - http://www.docep.wa.gov.au/lr/LabourRelations/Content/Wages%20and%20Conditions/Public%20Holidays/Public_Holidays.html
6
- # - http://www.wst.tas.gov.au/employment_info/public_holidays
7
- # - https://www.fairwork.gov.au/leave/public-holidays/list-of-public-holidays
8
- ---
9
- months:
10
- 0:
11
- - name: Good Friday
12
- regions: [au]
13
- function: easter(year)
14
- function_modifier: -2
15
- - name: Easter Saturday
16
- regions: [au_nsw, au_vic, au_qld, au_nt, au_act, au_sa]
17
- function: easter(year)
18
- function_modifier: -1
19
- - name: Easter Sunday
20
- regions: [au_nsw, au_vic]
21
- function: easter(year)
22
- - name: Easter Monday
23
- regions: [au]
24
- function: easter(year)
25
- function_modifier: 1
26
- 1:
27
- - name: New Year's Day
28
- regions: [au]
29
- mday: 1
30
- observed: to_monday_if_weekend(date)
31
- - name: Australia Day
32
- regions: [au]
33
- mday: 26
34
- observed: to_monday_if_weekend(date)
35
- 2:
36
- - name: Royal Hobart Regatta
37
- regions: [au_tas_south]
38
- week: 2
39
- wday: 1
40
- 3:
41
- - name: Labour Day
42
- regions: [au_wa]
43
- week: 1
44
- wday: 1
45
- - name: Eight Hours Day
46
- regions: [au_tas]
47
- week: 2
48
- wday: 1
49
- - name: Labour Day
50
- regions: [au_vic]
51
- week: 2
52
- wday: 1
53
- - name: March Public Holiday
54
- regions: [au_sa]
55
- function: march_pub_hol_sa(year)
56
- 4:
57
- - name: ANZAC Day
58
- regions: [au]
59
- mday: 25
60
- - name: ANZAC Day
61
- regions: [au_nsw, au_vic, au_qld, au_nt, au_act, au_sa, au_tas]
62
- mday: 25
63
- observed: to_monday_if_sunday(date)
64
- - name: ANZAC Day
65
- regions: [au_wa]
66
- mday: 25
67
- observed: to_monday_if_weekend(date)
68
- 5:
69
- - name: Labour Day
70
- regions: [au_qld]
71
- function: qld_labour_day_may(year)
72
- - name: May Day
73
- regions: [au_nt]
74
- week: 1
75
- wday: 1
76
- - name: May Public Holiday
77
- regions: [au_sa]
78
- function: may_pub_hol_sa(year)
79
- 6:
80
- - name: Foundation Day
81
- regions: [au_wa]
82
- week: 1
83
- wday: 1
84
- - name: Queen's Birthday
85
- regions: [au_act, au_nsw, au_sa, au_tas, au_nt, au_vic]
86
- week: 2
87
- wday: 1
88
- - name: Queen's Birthday
89
- regions: [au_qld]
90
- function: qld_queens_birthday_june(year)
91
- - name: Queensland Day
92
- regions: [au_qld]
93
- mday: 6
94
- type: informal
95
- 7:
96
- - name: Cairns Show
97
- regions: [au_qld_cairns]
98
- week: 3
99
- wday: 5
100
- 8:
101
- - name: Ekka
102
- regions: [au_qld_brisbane]
103
- week: -3
104
- wday: 3
105
- 9:
106
- - name: Queen's Birthday
107
- regions: [au_wa]
108
- week: -1
109
- wday: 1
110
- - name: "Family & Community Day"
111
- regions: [au_act]
112
- week: -1
113
- wday: 1
114
- 10:
115
- - name: Friday before the AFL Grand Final
116
- regions: [au_vic]
117
- function: afl_grand_final(year)
118
- - name: Labour Day
119
- regions: [au_act, au_nsw, au_sa]
120
- week: 1
121
- wday: 1
122
- - name: Labour Day
123
- regions: [au_qld]
124
- function: qld_labour_day_october(year)
125
- observed: to_monday_if_weekend(date)
126
- - name: Queen's Birthday
127
- regions: [au_qld]
128
- function: qld_queens_bday_october(year)
129
- observed: to_monday_if_weekend(date)
130
- - name: Royal Hobart Show
131
- regions: [au_tas_south]
132
- function: hobart_show_day(year)
133
- 11:
134
- - name: G20 Day
135
- regions: [au_qld_brisbane]
136
- function: g20_day_2014_only(year)
137
- - name: Recreation Day # http://www.timeanddate.com/holidays/australia/recreation-day
138
- regions: [au_tas_north]
139
- wday: 1
140
- week: 1
141
- - name: Melbourne Cup Day
142
- regions: [au_vic_melbourne]
143
- week: 1
144
- wday: 2
145
- 12:
146
- - name: Christmas Day # CHRISTMAS DAY - ACT, NSW, QLD, Tas, WA observe on 27th (and 25th) if 25th is a Sunday
147
- regions: [au_qld, au_nsw, au_act, au_tas, au_wa]
148
- mday: 25
149
- observed: to_tuesday_if_sunday_or_monday_if_saturday(date)
150
- - name: Christmas Day # CHRISTMAS DAY - SA observes on 26th if 25th is a Sunday (Boxing Day goes to 27th)
151
- regions: [au_sa]
152
- mday: 25
153
- observed: to_monday_if_weekend(date)
154
- - name: Christmas Day # CHRISTMAS DAY - Victoria and NT don't observe 25th if weekend - xmas is on the 27th
155
- regions: [au_vic, au_nt]
156
- function: xmas_to_weekday_if_weekend(year)
157
- - name: Boxing Day
158
- regions: [au_nsw, au_vic, au_qld, au_act, au_wa]
159
- mday: 26
160
- observed: to_tuesday_if_sunday_or_monday_if_saturday(date)
161
- - name: Boxing Day
162
- regions: [au_sa]
163
- function: to_weekday_if_boxing_weekend_from_year_or_to_tuesday_if_monday(year)
164
- - name: Boxing Day
165
- regions: [au_tas, au_nt]
166
- function: to_weekday_if_boxing_weekend_from_year(year)
167
-
168
- methods:
169
- afl_grand_final:
170
- arguments: year
171
- source: |
172
- if year == 2015
173
- Date.civil(2015, 10, 2)
174
- end
175
- qld_queens_bday_october:
176
- # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
177
- # celebrated twice in 2012
178
- # in october again from 2016
179
- arguments: year
180
- source: |
181
- if year >= 2016
182
- DateCalculatorFactory.day_of_month_calculator.call(year, 10, 1, 1)
183
- elsif year == 2012
184
- 1
185
- else
186
- nil
187
- end
188
- qld_queens_birthday_june:
189
- # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
190
- # in june until 2015
191
- arguments: year
192
- source: |
193
- if year <= 2015
194
- DateCalculatorFactory.day_of_month_calculator.call(year, 6, 2, 1)
195
- end
196
- qld_labour_day_may:
197
- # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
198
- # for 2013 to 2016 it was in October, otherwise it's in May
199
- arguments: year
200
- source: |
201
- if year < 2013 || year >= 2016
202
- DateCalculatorFactory.day_of_month_calculator.call(year, 5, 1, 1)
203
- end
204
- qld_labour_day_october:
205
- # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
206
- # for 2013 to 2016 it was in October, otherwise it's in May
207
- arguments: year
208
- source: |
209
- if year >= 2013 && year < 2016
210
- DateCalculatorFactory.day_of_month_calculator.call(year, 10, 1, 1)
211
- end
212
- g20_day_2014_only:
213
- # http://www.justice.qld.gov.au/fair-and-safe-work/industrial-relations/public-holidays/dates
214
- # G20 day in brisbane, in 2014, on november 14
215
- arguments: year
216
- source: |
217
- year == 2014 ? 14 : nil
218
- hobart_show_day:
219
- # http://worksafe.tas.gov.au/__data/assets/pdf_file/0008/287036/Public_Holidays_2014.pdf
220
- # The Thursday before the fourth Saturday in October.
221
- arguments: year
222
- source: |
223
- fourth_sat_in_oct = Date.civil(year, 10, Holidays::DateCalculatorFactory.day_of_month_calculator.call(year, 10, 4, :saturday))
224
- fourth_sat_in_oct - 2 # the thursday before
225
- march_pub_hol_sa:
226
- # http://www.safework.sa.gov.au/show_page.jsp?id=2483#.VQ9Mfmb8-8E
227
- # The Holidays Act 1910 provides for the third Monday in May to be a public holiday. Since 2006 this public holiday has been observed on the second Monday in March through the issuing of a special Proclamation by the Governor.
228
- arguments: year
229
- source: |
230
- if year < 2006
231
- nil
232
- else
233
- Date.civil(year, 3, Holidays::DateCalculatorFactory.day_of_month_calculator.call(year, 3, :second, :monday))
234
- end
235
- may_pub_hol_sa:
236
- # http://www.safework.sa.gov.au/show_page.jsp?id=2483#.VQ9Mfmb8-8E
237
- # The Holidays Act 1910 provides for the third Monday in May to be a public holiday. Since 2006 this public holiday has been observed on the second Monday in March through the issuing of a special Proclamation by the Governor.
238
- arguments: year
239
- source: |
240
- if year >= 2006
241
- nil
242
- else
243
- Date.civil(year, 5, Holidays::DateCalculatorFactory.day_of_month_calculator.call(year, 5, :third, :monday))
244
- end
245
-
246
- tests: |
247
- {Date.civil(2007,1,1) => 'New Year\'s Day',
248
- Date.civil(2007,1,26) => 'Australia Day',
249
- Date.civil(2007,4,6) => 'Good Friday',
250
- Date.civil(2007,4,9) => 'Easter Monday',
251
- Date.civil(2007,4,25) => 'ANZAC Day'}.each do |date, name|
252
- assert_equal name, (Holidays.on(date, :au, :informal)[0] || {})[:name]
253
- end
254
-
255
- [:au_sa, :au_act, :au_nsw, :au_].each do |r|
256
- assert_equal 'Labour Day', Holidays.on(Date.civil(2007,10,1), r)[0][:name]
257
- end
258
-
259
- [:au_sa, :au_act, :au_nsw, :au_vic, :au_tas, :au_qld, :au_nt, :au_].each do |r|
260
- assert_equal 'Queen\'s Birthday', Holidays.on(Date.civil(2007,6,11), r)[0][:name]
261
- end
262
-
263
- assert_equal 'Labour Day', Holidays.on(Date.civil(2007,3,5), :au_wa)[0][:name]
264
- assert_equal 'Labour Day', Holidays.on(Date.civil(2007,3,12), :au_vic)[0][:name]
265
- assert_equal 'Labour Day', Holidays.on(Date.civil(2007,5,7), :au_qld)[0][:name]
266
-
267
- assert_equal 'Easter Sunday', Holidays.on(Date.civil(2007,4,8), :au_nsw)[0][:name]
268
-
269
- assert_equal 'May Day', Holidays.on(Date.civil(2007,5,7), :au_nt)[0][:name]
270
-
271
- assert_equal 'Eight Hours Day', Holidays.on(Date.civil(2007,3,12), :au_tas)[0][:name]
272
-
273
- assert_equal 'Labour Day', Holidays.on(Date.civil(2013,10,7), :au_qld)[0][:name]
274
- assert_equal 'Labour Day', Holidays.on(Date.civil(2012,5,7), :au_qld)[0][:name]
275
- assert_equal 'Labour Day', Holidays.on(Date.civil(2015,10,5), :au_qld)[0][:name]
276
- assert_equal 'Labour Day', Holidays.on(Date.civil(2016,5,2), :au_qld)[0][:name]
277
-
278
- assert_equal "Queen's Birthday", Holidays.on(Date.civil(2012,6,11), :au_qld)[0][:name]
279
- assert_equal "Queen's Birthday", Holidays.on(Date.civil(2012,10,1), :au_qld)[0][:name]
280
- assert_equal "Queen's Birthday", Holidays.on(Date.civil(2013,6,10), :au_qld)[0][:name]
281
- assert_equal "Queen's Birthday", Holidays.on(Date.civil(2015,6,8), :au_qld)[0][:name]
282
- assert_equal "Queen's Birthday", Holidays.on(Date.civil(2016,10,3), :au_qld)[0][:name]
283
-
284
- assert_equal "Queen's Birthday", Holidays.on(Date.civil(2014, 9, 29), :au_wa)[0][:name]
285
- assert_equal "Queen's Birthday", Holidays.on(Date.civil(2015, 9, 28), :au_wa)[0][:name]
286
- assert_equal "Queen's Birthday", Holidays.on(Date.civil(2016, 9, 26), :au_wa)[0][:name]
287
-
288
- assert_equal "Family & Community Day", Holidays.on(Date.civil(2014, 9, 29), :au_act)[0][:name]
289
- assert_equal "Family & Community Day", Holidays.on(Date.civil(2015, 9, 28), :au_act)[0][:name]
290
- assert_equal "Family & Community Day", Holidays.on(Date.civil(2016, 9, 26), :au_act)[0][:name]
291
-
292
- assert_equal 'Australia Day', Holidays.on(Date.civil(2014,1,26), :au_qld)[0][:name]
293
- assert_equal 'Australia Day', Holidays.on(Date.civil(2014,1,27), :au_qld, :observed)[0][:name]
294
-
295
- assert_equal 'Cairns Show', Holidays.on(Date.civil(2014,7,18), :au_qld_cairns)[0][:name]
296
- assert_equal 'Cairns Show', Holidays.on(Date.civil(2013,7,19), :au_qld_cairns)[0][:name]
297
-
298
- assert_equal 'Royal Hobart Show', Holidays.on(Date.civil(2013, 10, 24), :au_tas_south)[0][:name]
299
- assert_equal 'Royal Hobart Show', Holidays.on(Date.civil(2014, 10, 23), :au_tas_south)[0][:name]
300
- assert_equal 'Royal Hobart Show', Holidays.on(Date.civil(2015, 10, 22), :au_tas_south)[0][:name]
301
- assert_equal 'Royal Hobart Show', Holidays.on(Date.civil(2016, 10, 20), :au_tas_south)[0][:name]
302
-
303
- assert_equal 'Recreation Day', Holidays.on(Date.civil(2013, 11, 4), :au_tas_north)[0][:name]
304
- assert_equal 'Recreation Day', Holidays.on(Date.civil(2014, 11, 3), :au_tas_north)[0][:name]
305
- assert_equal 'Recreation Day', Holidays.on(Date.civil(2015, 11, 2), :au_tas_north)[0][:name]
306
- assert_equal 'Recreation Day', Holidays.on(Date.civil(2016, 11, 7), :au_tas_north)[0][:name]
307
-
308
- assert_nil Date.civil(2014,11,4).holidays(:au_vic)[0]
309
- assert_nil Date.civil(2015,11,3).holidays(:au_vic)[0]
310
-
311
- assert_equal 'Melbourne Cup Day', Holidays.on(Date.civil(2014,11,4), :au_vic_melbourne)[0][:name]
312
- assert_equal 'Melbourne Cup Day', Holidays.on(Date.civil(2015,11,3), :au_vic_melbourne)[0][:name]
313
-
314
- assert_equal 'Friday before the AFL Grand Final', Date.civil(2015,10,2).holidays(:au_vic)[0][:name]
315
- assert_nil Date.civil(2016,10,2).holidays(:au_vic)[0]
316
-
317
- assert_equal "May Public Holiday", Date.civil(2005, 5, 16).holidays(:au_sa)[0][:name]
318
- assert_equal [], Date.civil(2014, 5, 19).holidays(:au_sa)
319
-
320
- assert_equal [], Date.civil(2005, 3, 14).holidays(:au_sa)
321
- assert_equal "March Public Holiday", Date.civil(2014, 3, 10).holidays(:au_sa)[0][:name]
322
- assert_equal "March Public Holiday", Date.civil(2015, 3, 9).holidays(:au_sa)[0][:name]
323
- assert_equal "March Public Holiday", Date.civil(2016, 3, 14).holidays(:au_sa)[0][:name]
324
- assert_equal "March Public Holiday", Date.civil(2017, 3, 13).holidays(:au_sa)[0][:name]
325
-
326
- assert_equal "ANZAC Day", Date.civil(2015, 4, 25).holidays(:au_qld)[0][:name]
327
- assert_equal "ANZAC Day", Date.civil(2015, 4, 25).holidays(:au_wa)[0][:name]
328
- assert_equal [], Date.civil(2015, 4, 27).holidays(:au_qld, :observed)
329
- assert_equal "ANZAC Day", Date.civil(2015, 4, 27).holidays(:au_wa, :observed)[0][:name]
330
-
331
- # BOXING DAY - QLD observes weekend and monday
332
- assert_equal "Boxing Day", Date.civil(2015, 12, 26).holidays(:au_qld)[0][:name]
333
- assert_equal "Boxing Day", Date.civil(2015, 12, 28).holidays(:au_qld, :observed)[0][:name]
334
-
335
- # BOXING DAY - SA gets monday only. same for TAS and NT.
336
- assert_nil Date.civil(2015, 12, 26).holidays(:au_sa)[0]
337
- assert_equal "Boxing Day", Date.civil(2015, 12, 28).holidays(:au_sa)[0][:name]
338
- assert_nil Date.civil(2015, 12, 26).holidays(:au_tas)[0]
339
- assert_equal "Boxing Day", Date.civil(2015, 12, 28).holidays(:au_tas)[0][:name]
340
- assert_nil Date.civil(2015, 12, 26).holidays(:au_nt)[0]
341
- assert_equal "Boxing Day", Date.civil(2015, 12, 28).holidays(:au_nt)[0][:name]
342
-
343
- assert_equal 'G20 Day', Holidays.on(Date.civil(2014,11,14), :au_qld_brisbane)[0][:name]
344
- assert_equal [], Holidays.on(Date.civil(2014,11,14), :au_qld)
345
- assert_equal [], Holidays.on(Date.civil(2015,11,14), :au_qld_brisbane)
346
-
347
- assert_equal 'Royal Hobart Regatta', Holidays.on(Date.civil(2012, 2, 13), :au_tas_south)[0][:name]
348
- assert_equal 'Royal Hobart Regatta', Holidays.on(Date.civil(2014, 2, 10), :au_tas_south)[0][:name]
349
- assert_equal 'Royal Hobart Regatta', Holidays.on(Date.civil(2015, 2, 9), :au_tas_south)[0][:name]
350
- assert_equal 'Royal Hobart Regatta', Holidays.on(Date.civil(2016, 2, 8), :au_tas_south)[0][:name]
351
-
352
- # CHRISTMAS DAY - ACT, NSW, QLD, Tas, WA observe on 27th (and 25th) if 25th is a Sunday
353
- assert_equal "Christmas Day", Date.civil(2016, 12, 25).holidays(:au_qld)[0][:name]
354
- assert_equal "Christmas Day", Date.civil(2016, 12, 27).holidays(:au_qld, :observed)[0][:name]
355
- assert_equal "Christmas Day", Date.civil(2016, 12, 25).holidays(:au_nsw)[0][:name]
356
- assert_equal "Christmas Day", Date.civil(2016, 12, 27).holidays(:au_nsw, :observed)[0][:name]
357
- assert_equal "Christmas Day", Date.civil(2016, 12, 25).holidays(:au_act)[0][:name]
358
- assert_equal "Christmas Day", Date.civil(2016, 12, 27).holidays(:au_act, :observed)[0][:name]
359
- assert_equal "Christmas Day", Date.civil(2016, 12, 25).holidays(:au_tas)[0][:name]
360
- assert_equal "Christmas Day", Date.civil(2016, 12, 27).holidays(:au_tas, :observed)[0][:name]
361
- assert_equal "Christmas Day", Date.civil(2016, 12, 25).holidays(:au_wa)[0][:name]
362
- assert_equal "Christmas Day", Date.civil(2016, 12, 27).holidays(:au_wa, :observed)[0][:name]
363
-
364
- # CHRISTMAS DAY - SA observes on 26th if 25th is a Sunday (Boxing Day goes to 27th)
365
- assert_equal "Christmas Day", Date.civil(2016, 12, 25).holidays(:au_sa)[0][:name]
366
- assert_equal "Christmas Day", Date.civil(2016, 12, 26).holidays(:au_sa, :observed)[0][:name]
367
- assert_equal "Boxing Day", Date.civil(2016, 12, 27).holidays(:au_sa)[0][:name]
368
-
369
- # CHRISTMAS DAY - Victoria and NT don't observe 25th if weekend - xmas is on the 27th
370
- assert_nil Date.civil(2016, 12, 25).holidays(:au_vic)[0]
371
- assert_nil Date.civil(2016, 12, 25).holidays(:au_nt)[0]
372
- assert_equal "Boxing Day", Date.civil(2016, 12, 26).holidays(:au_vic)[0][:name]
373
- assert_equal "Boxing Day", Date.civil(2016, 12, 26).holidays(:au_nt)[0][:name]
374
- assert_equal "Christmas Day", Date.civil(2016, 12, 27).holidays(:au_vic)[0][:name]
375
- assert_equal "Christmas Day", Date.civil(2016, 12, 27).holidays(:au_nt)[0][:name]
@@ -1,69 +0,0 @@
1
- # Belgium holiday definitions for the Ruby Holiday gem in French.
2
- #
3
- # Updated: 2012-06-20.
4
- # Sources:
5
- # - http://en.wikipedia.org/wiki/Public_holidays_in_Belgium
6
- ---
7
- months:
8
- 0:
9
- - name: Pâques
10
- regions: [be_fr]
11
- function: easter(year)
12
- - name: Lundi de Pâques
13
- regions: [be_fr]
14
- function: easter(year)
15
- function_modifier: 1
16
- - name: Ascension
17
- regions: [be_fr]
18
- function: easter(year)
19
- function_modifier: 39
20
- - name: Pentecôte
21
- regions: [be_fr]
22
- function: easter(year)
23
- function_modifier: 49
24
- - name: Lundi de Pentecôte
25
- regions: [be_fr]
26
- function: easter(year)
27
- function_modifier: 50
28
- 1:
29
- - name: Jour de l'an
30
- regions: [be_fr]
31
- mday: 1
32
- 5:
33
- - name: Fête du travail
34
- regions: [be_fr]
35
- mday: 1
36
- 7:
37
- - name: Fête nationale
38
- regions: [be_fr]
39
- mday: 21
40
- 8:
41
- - name: Assomption
42
- regions: [be_fr]
43
- mday: 15
44
- 11:
45
- - name: Toussaint
46
- regions: [be_fr]
47
- mday: 1
48
- - name: Armistice 1918
49
- regions: [be_fr]
50
- mday: 11
51
- 12:
52
- - name: Noël
53
- regions: [be_fr]
54
- mday: 25
55
- tests: |
56
- {Date.civil(2007,1,1) => 'Jour de l\'an',
57
- Date.civil(2007,4,8) => 'Pâques',
58
- Date.civil(2007,4,9) => 'Lundi de Pâques',
59
- Date.civil(2007,5,1) => 'Fête du travail',
60
- Date.civil(2007,5,17) => 'Ascension',
61
- Date.civil(2007,5,27) => 'Pentecôte',
62
- Date.civil(2007,5,28) => 'Lundi de Pentecôte',
63
- Date.civil(2007,7,21) => 'Fête nationale',
64
- Date.civil(2007,8,15) => 'Assomption',
65
- Date.civil(2007,11,1) => 'Toussaint',
66
- Date.civil(2007,11,11) => 'Armistice 1918',
67
- Date.civil(2007,12,25) => 'Noël'}.each do |date, name|
68
- assert_equal name, (Holidays.on(date, :be_fr, :informal)[0] || {})[:name]
69
- end
@@ -1,69 +0,0 @@
1
- # Belgium holiday definitions for the Ruby Holiday gem. In Dutch.
2
- #
3
- # Updated: 2016-02-17.
4
- # Sources:
5
- # - http://en.wikipedia.org/wiki/Public_holidays_in_Belgium
6
- ---
7
- months:
8
- 0:
9
- - name: Pasen
10
- regions: [be_nl]
11
- function: easter(year)
12
- - name: Paasmaandag
13
- regions: [be_nl]
14
- function: easter(year)
15
- function_modifier: 1
16
- - name: O.H. Hemelvaart
17
- regions: [be_nl]
18
- function: easter(year)
19
- function_modifier: 39
20
- - name: Pinksteren
21
- regions: [be_nl]
22
- function: easter(year)
23
- function_modifier: 49
24
- - name: Pinkstermaandag
25
- regions: [be_nl]
26
- function: easter(year)
27
- function_modifier: 50
28
- 1:
29
- - name: Nieuwjaar
30
- regions: [be_nl]
31
- mday: 1
32
- 5:
33
- - name: Feest van de Arbeid
34
- regions: [be_nl]
35
- mday: 1
36
- 7:
37
- - name: Nationale Feestdag
38
- regions: [be_nl]
39
- mday: 21
40
- 8:
41
- - name: O.L.V. Hemelvaart
42
- regions: [be_nl]
43
- mday: 15
44
- 11:
45
- - name: Allerheiligen
46
- regions: [be_nl]
47
- mday: 1
48
- - name: Wapenstilstand 1918
49
- regions: [be_nl]
50
- mday: 11
51
- 12:
52
- - name: Kerstmis
53
- regions: [be_nl]
54
- mday: 25
55
- tests: |
56
- {Date.civil(2007,1,1) => 'Nieuwjaar',
57
- Date.civil(2007,4,8) => 'Pasen',
58
- Date.civil(2007,4,9) => 'Paasmaandag',
59
- Date.civil(2007,5,1) => 'Feest van de Arbeid',
60
- Date.civil(2007,5,17) => 'O.H. Hemelvaart',
61
- Date.civil(2007,5,27) => 'Pinksteren',
62
- Date.civil(2007,5,28) => 'Pinkstermaandag',
63
- Date.civil(2007,7,21) => 'Nationale Feestdag',
64
- Date.civil(2007,8,15) => 'O.L.V. Hemelvaart',
65
- Date.civil(2007,11,1) => 'Allerheiligen',
66
- Date.civil(2007,11,11) => 'Wapenstilstand 1918',
67
- Date.civil(2007,12,25) => 'Kerstmis'}.each do |date, name|
68
- assert_equal name, (Holidays.on(date, :be_nl, :informal)[0] || {})[:name]
69
- end
data/definitions/bg.yaml DELETED
@@ -1,127 +0,0 @@
1
- # Bulgaria holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2015-04-01.
4
- # Source: http://en.wikipedia.org/wiki/Public_holidays_in_Bulgaria
5
- ---
6
- months:
7
- 0:
8
- - name: Good Friday
9
- regions: [bg_en]
10
- function: orthodox_easter_julian(year)
11
- function_modifier: -2
12
- - name: Разпети петък
13
- regions: [bg_bg]
14
- function: orthodox_easter_julian(year)
15
- function_modifier: -2
16
- - name: Holy Saturday
17
- regions: [bg_en]
18
- function: orthodox_easter_julian(year)
19
- function_modifier: -1
20
- - name: Велика събота
21
- regions: [bg_bg]
22
- function: orthodox_easter_julian(year)
23
- function_modifier: -1
24
- - name: Easter Sunday
25
- regions: [bg_en]
26
- function: orthodox_easter_julian(year)
27
- - name: Възкресение Христово. Великден
28
- regions: [bg_bg]
29
- function: orthodox_easter_julian(year)
30
- - name: Easter Monday
31
- regions: [bg_en]
32
- function: orthodox_easter_julian(year)
33
- function_modifier: 1
34
- - name: Възкресение Христово. Великден
35
- regions: [bg_bg]
36
- function: orthodox_easter_julian(year)
37
- function_modifier: 1
38
- 1:
39
- - name: New Year's Day
40
- regions: [bg_en]
41
- mday: 1
42
- - name: Нова година
43
- regions: [bg_bg]
44
- mday: 1
45
- 3:
46
- - name: Liberation Day
47
- regions: [bg_en]
48
- mday: 3
49
- - name: Освобожението на България
50
- regions: [bg_bg]
51
- mday: 3
52
- 5:
53
- - name: Labour Day
54
- regions: [bg_en]
55
- mday: 1
56
- - name: Ден на труда
57
- regions: [bg_bg]
58
- mday: 1
59
- - name: St. George's Day
60
- regions: [bg_en]
61
- mday: 6
62
- - name: Гергьовден. Ден на храбростта
63
- regions: [bg_bg]
64
- mday: 6
65
- - name: Slavic Literacy Day
66
- regions: [bg_en]
67
- mday: 24
68
- - name: Ден на славянската писменост
69
- regions: [bg_bg]
70
- mday: 24
71
- 9:
72
- - name: Unification Day
73
- regions: [bg_en]
74
- mday: 6
75
- - name: Ден на Съединението
76
- regions: [bg_bg]
77
- mday: 6
78
- - name: The Independence Day
79
- regions: [bg_en]
80
- mday: 22
81
- - name: Ден на Независимостта
82
- regions: [bg_bg]
83
- mday: 22
84
- 11:
85
- - name: Revival Leader's Day
86
- regions: [bg_en]
87
- mday: 1
88
- - name: Ден на Народните будители
89
- regions: [bg_bg]
90
- mday: 1
91
- 12:
92
- - name: Christmas Eve
93
- regions: [bg_en]
94
- mday: 24
95
- - name: Бъдни вечер
96
- regions: [bg_bg]
97
- mday: 24
98
- - name: Christmas
99
- regions: [bg_en]
100
- mday: 25
101
- - name: Рождество Христово. Коледа
102
- regions: [bg_bg]
103
- mday: 25
104
- - name: Christmas
105
- regions: [bg_en]
106
- mday: 26
107
- - name: Рождество Христово. Коледа
108
- regions: [bg_bg]
109
- mday: 26
110
- tests: |
111
- {Date.civil(2015,1,1) => "New Year's Day",
112
- Date.civil(2015,3,3) => "Liberation Day",
113
- Date.civil(2015,3,28) => "Good Friday",
114
- Date.civil(2015,3,29) => "Holy Saturday",
115
- Date.civil(2015,3,30) => "Easter Sunday",
116
- Date.civil(2015,3,31) => "Easter Monday",
117
- Date.civil(2015,5,1) => "Labour Day",
118
- Date.civil(2015,5,6) => "St. George's Day",
119
- Date.civil(2015,5,24) => "Slavic Literacy Day",
120
- Date.civil(2015,9,6) => "Unification Day",
121
- Date.civil(2015,9,22) => "The Independence Day",
122
- Date.civil(2015,11,1) => "Revival Leader's Day",
123
- Date.civil(2015,12,24) => "Christmas Eve",
124
- Date.civil(2015,12,25) => "Christmas",
125
- Date.civil(2015,12,26) => "Christmas"}.each do |date, name|
126
- assert_equal name, (Holidays.on(date, :bg_en)[0] || {})[:name]
127
- end