holidays 6.6.1 → 8.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +25 -0
  3. data/CHANGELOG.md +72 -0
  4. data/README.md +10 -6
  5. data/doc/CONTRIBUTING.md +2 -1
  6. data/holidays.gemspec +5 -5
  7. data/lib/generated_definitions/MANIFEST +11 -5
  8. data/lib/generated_definitions/REGIONS.rb +2 -2
  9. data/lib/generated_definitions/ar.rb +28 -9
  10. data/lib/generated_definitions/at.rb +2 -2
  11. data/lib/generated_definitions/au.rb +47 -10
  12. data/lib/generated_definitions/be_fr.rb +2 -2
  13. data/lib/generated_definitions/be_nl.rb +2 -2
  14. data/lib/generated_definitions/bg.rb +2 -2
  15. data/lib/generated_definitions/br.rb +2 -2
  16. data/lib/generated_definitions/ca.rb +25 -17
  17. data/lib/generated_definitions/ch.rb +15 -3
  18. data/lib/generated_definitions/cl.rb +7 -7
  19. data/lib/generated_definitions/co.rb +2 -2
  20. data/lib/generated_definitions/cr.rb +2 -2
  21. data/lib/generated_definitions/cz.rb +2 -2
  22. data/lib/generated_definitions/de.rb +11 -7
  23. data/lib/generated_definitions/dk.rb +3 -3
  24. data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -10
  25. data/lib/generated_definitions/ee.rb +2 -2
  26. data/lib/generated_definitions/el.rb +2 -2
  27. data/lib/generated_definitions/es.rb +6 -4
  28. data/lib/generated_definitions/europe.rb +119 -32
  29. data/lib/generated_definitions/{federal_reserve.rb → federalreserve.rb} +15 -14
  30. data/lib/generated_definitions/federalreservebanks.rb +35 -0
  31. data/lib/generated_definitions/fedex.rb +2 -2
  32. data/lib/generated_definitions/fi.rb +2 -2
  33. data/lib/generated_definitions/fr.rb +4 -4
  34. data/lib/generated_definitions/gb.rb +15 -7
  35. data/lib/generated_definitions/ge.rb +2 -2
  36. data/lib/generated_definitions/hk.rb +2 -2
  37. data/lib/generated_definitions/hr.rb +10 -8
  38. data/lib/generated_definitions/hu.rb +4 -3
  39. data/lib/generated_definitions/ie.rb +2 -2
  40. data/lib/generated_definitions/is.rb +2 -2
  41. data/lib/generated_definitions/it.rb +16 -7
  42. data/lib/generated_definitions/jp.rb +31 -16
  43. data/lib/generated_definitions/kr.rb +2 -2
  44. data/lib/generated_definitions/kz.rb +38 -0
  45. data/lib/generated_definitions/li.rb +2 -2
  46. data/lib/generated_definitions/lt.rb +2 -2
  47. data/lib/generated_definitions/lu.rb +4 -2
  48. data/lib/generated_definitions/lv.rb +56 -0
  49. data/lib/generated_definitions/ma.rb +2 -2
  50. data/lib/generated_definitions/mt_en.rb +2 -2
  51. data/lib/generated_definitions/mt_mt.rb +2 -2
  52. data/lib/generated_definitions/mx.rb +7 -7
  53. data/lib/generated_definitions/my.rb +2 -2
  54. data/lib/generated_definitions/nerc.rb +2 -2
  55. data/lib/generated_definitions/ng.rb +33 -0
  56. data/lib/generated_definitions/nl.rb +2 -2
  57. data/lib/generated_definitions/no.rb +2 -2
  58. data/lib/generated_definitions/{north_america.rb → northamerica.rb} +34 -26
  59. data/lib/generated_definitions/nyse.rb +3 -2
  60. data/lib/generated_definitions/nz.rb +41 -3
  61. data/lib/generated_definitions/pe.rb +2 -2
  62. data/lib/generated_definitions/ph.rb +2 -2
  63. data/lib/generated_definitions/pl.rb +2 -2
  64. data/lib/generated_definitions/pt.rb +2 -2
  65. data/lib/generated_definitions/ro.rb +6 -3
  66. data/lib/generated_definitions/rs_cyrl.rb +3 -3
  67. data/lib/generated_definitions/rs_la.rb +3 -3
  68. data/lib/generated_definitions/ru.rb +2 -2
  69. data/lib/generated_definitions/scandinavia.rb +3 -3
  70. data/lib/generated_definitions/se.rb +2 -2
  71. data/lib/generated_definitions/sg.rb +2 -2
  72. data/lib/generated_definitions/si.rb +4 -3
  73. data/lib/generated_definitions/sk.rb +2 -2
  74. data/lib/generated_definitions/{south_america.rb → southamerica.rb} +32 -13
  75. data/lib/generated_definitions/th.rb +36 -0
  76. data/lib/generated_definitions/tn.rb +2 -2
  77. data/lib/generated_definitions/tr.rb +7 -5
  78. data/lib/generated_definitions/ua.rb +37 -0
  79. data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -61
  80. data/lib/generated_definitions/ups.rb +2 -2
  81. data/lib/generated_definitions/us.rb +9 -9
  82. data/lib/generated_definitions/ve.rb +2 -2
  83. data/lib/generated_definitions/vi.rb +2 -2
  84. data/lib/generated_definitions/za.rb +3 -3
  85. data/lib/holidays/definition/context/generator.rb +23 -70
  86. data/lib/holidays/definition/generator/module.rb +54 -0
  87. data/lib/holidays/definition/generator/regions.rb +1 -1
  88. data/lib/holidays/definition/repository/holidays_by_month.rb +9 -1
  89. data/lib/holidays/factory/definition.rb +7 -0
  90. data/lib/holidays/finder/context/search.rb +35 -31
  91. data/lib/holidays/finder/rules/year_range.rb +30 -54
  92. data/lib/holidays/version.rb +1 -1
  93. data/lib/holidays.rb +2 -0
  94. data/test/coverage_report.rb +23 -5
  95. data/test/data/test_custom_year_range_holiday_defs.yaml +6 -10
  96. data/test/data/test_multiple_regions_with_conflicts_region_1.yaml +38 -0
  97. data/test/data/test_multiple_regions_with_conflicts_region_2.yaml +38 -0
  98. data/test/defs/test_defs_ar.rb +20 -4
  99. data/test/defs/test_defs_au.rb +22 -0
  100. data/test/defs/test_defs_ca.rb +71 -8
  101. data/test/defs/test_defs_ch.rb +4 -0
  102. data/test/defs/test_defs_co.rb +3 -3
  103. data/test/defs/test_defs_de.rb +8 -0
  104. data/test/defs/test_defs_dk.rb +4 -0
  105. data/test/defs/{test_defs_ecb_target.rb → test_defs_ecbtarget.rb} +11 -11
  106. data/test/defs/test_defs_es.rb +2 -0
  107. data/test/defs/test_defs_europe.rb +233 -14
  108. data/test/defs/test_defs_federalreserve.rb +119 -0
  109. data/test/defs/test_defs_federalreservebanks.rb +251 -0
  110. data/test/defs/test_defs_fr.rb +3 -3
  111. data/test/defs/test_defs_gb.rb +42 -0
  112. data/test/defs/test_defs_hr.rb +6 -6
  113. data/test/defs/test_defs_hu.rb +12 -4
  114. data/test/defs/test_defs_it.rb +20 -0
  115. data/test/defs/test_defs_jp.rb +22 -2
  116. data/test/defs/test_defs_kz.rb +39 -0
  117. data/test/defs/test_defs_lu.rb +6 -0
  118. data/test/defs/test_defs_lv.rb +98 -0
  119. data/test/defs/test_defs_mx.rb +3 -1
  120. data/test/defs/test_defs_ng.rb +29 -0
  121. data/test/defs/{test_defs_north_america.rb → test_defs_northamerica.rb} +85 -20
  122. data/test/defs/test_defs_nyse.rb +7 -0
  123. data/test/defs/test_defs_nz.rb +4 -0
  124. data/test/defs/test_defs_ro.rb +14 -0
  125. data/test/defs/test_defs_rs_cyrl.rb +1 -1
  126. data/test/defs/test_defs_rs_la.rb +1 -1
  127. data/test/defs/test_defs_scandinavia.rb +4 -0
  128. data/test/defs/{test_defs_south_america.rb → test_defs_southamerica.rb} +25 -9
  129. data/test/defs/test_defs_th.rb +33 -0
  130. data/test/defs/test_defs_tr.rb +7 -0
  131. data/test/defs/test_defs_ua.rb +41 -0
  132. data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -3
  133. data/test/defs/test_defs_us.rb +11 -11
  134. data/test/holidays/core_extensions/test_date.rb +3 -2
  135. data/test/holidays/definition/context/test_generator.rb +17 -20
  136. data/test/holidays/definition/generator/test_module.rb +268 -0
  137. data/test/holidays/definition/repository/test_holidays_by_month.rb +121 -1
  138. data/test/holidays/finder/rules/test_year_range.rb +43 -47
  139. data/test/integration/test_available_regions.rb +1 -1
  140. data/test/integration/test_custom_year_range_holidays.rb +0 -7
  141. data/test/integration/test_holidays.rb +2 -36
  142. data/test/integration/test_holidays_between.rb +11 -1
  143. data/test/integration/test_multiple_regions_with_conflict.rb +29 -0
  144. data/test/integration/test_nonstandard_regions.rb +25 -0
  145. metadata +61 -32
  146. data/test/defs/test_defs_federal_reserve.rb +0 -113
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 844c8c66842896fceda5b386a64bcfd8d03d51781ebc328bc246ecdc6e41effc
4
- data.tar.gz: 341f07eb7869fa24a501b1cc3380d36dc7a84fba5f3d70a3d821c53c560db416
3
+ metadata.gz: 572db74799733f361987b49b2e749a1f5953368bd56f89dedab02f217b86167c
4
+ data.tar.gz: 9a6bfce2599a6deb49ce351fcca8ea8fdc799b42fcd29c8cb0d9ed71185cefa2
5
5
  SHA512:
6
- metadata.gz: 937db688aa9a3eb0b0bd928041eadbfc30b97cf0ffe92f2ee92bf92b160dc44fff196c6c3c84deb5a7cd3bfc8dbdaa2d4d2fb1a91dab83b59da726b7912f43bd
7
- data.tar.gz: ba21c5e8ef10aa1507385c4cb62e531b9e9dc685190aa67dcd84753963726498828a4b46a9fabc2d4f090a1782bdcfa5325f0f1069214f383819d882d5b6e379
6
+ metadata.gz: dfe795b467494aaf0eb595f6355bf98ba9bbc503c065491261a498bb745db3d35ce38c6d5a9edefa1eee641bd8bd71838e2571220d5c3ffa58231a069688e401
7
+ data.tar.gz: 688be4308f0721b7a8ba6fa7e4e8bed668facab50132f266ab8fca1c9466e25677f917029dc9ce1a6862a4fd0df860822c10a891cc5d9d5c3ab020834484e7e7
@@ -0,0 +1,25 @@
1
+ name: Ruby
2
+ on:
3
+ push:
4
+ branches: [ "master" ]
5
+ pull_request:
6
+ branches: [ "master" ]
7
+ permissions:
8
+ contents: read
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', 'ruby-head']
15
+ env:
16
+ BUNDLER_NO_OLD_RUBYGEMS_WARNING: true
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@55283cc23133118229fd3f97f9336ee23a179fcf # v1.146.0
21
+ with:
22
+ ruby-version: ${{ matrix.ruby-version }}
23
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
24
+ - name: Run tests
25
+ run: make test
data/CHANGELOG.md CHANGED
@@ -1,5 +1,77 @@
1
1
  # Ruby Holidays Gem CHANGELOG
2
2
 
3
+ ## 8.7.1
4
+
5
+ * Fix testing issues and github action config, no behavior changes
6
+ * Remove Travis CI config
7
+
8
+ ## 8.7.0
9
+
10
+ * Update to [v5.6.2 definitions](https://github.com/holidays/definitions/releases/tag/v5.6.2). Please see the changelog for the definition details.
11
+ * Add support for ruby 2.7, 3.0, 3.1, 3.2, 3.3
12
+ * Add GitHub actions support since Travis CI is not free for OSS anymore
13
+
14
+ ## 8.6.0
15
+
16
+ * Update to [v5.5.0 definitions](https://github.com/holidays/definitions/releases/tag/v5.5.0). Please see the changelog for the definition details.
17
+ * Temporarily remove jruby from required jobs due to test coverage issues
18
+
19
+ ## 8.5.0
20
+
21
+ * Update submodule definitions.
22
+ * Thanks to contributors!!
23
+
24
+ ## 8.4.1
25
+
26
+ * Fix jp holidays from 2022.
27
+
28
+ ## 8.4.0
29
+
30
+ * Update submodule definitions
31
+ * Thanks to contributors!!
32
+
33
+
34
+ ## 8.3.0
35
+
36
+ * Update submodule definitions
37
+ * Remove test about feb 29 on non leap year.
38
+ * Thanks to contributors!!
39
+
40
+ ## 8.2.0
41
+
42
+ * Update submodule definitions. Thanks to contributors!!
43
+
44
+ ## 8.1.0
45
+
46
+ * Update submodule definitions, so that the newest holidays from the definition
47
+ gem are represent here.
48
+
49
+ ## 8.0.0
50
+
51
+ * Remove support for ruby 2.2 and ruby 2.3.
52
+ * Add support for latest ruby 2.6
53
+ * Update to [v5.0.1 definitions](https://github.com/holidays/definitions/releases/tag/v5.0.1). Please see the changelog for the definition details.
54
+
55
+ ## 7.1.0
56
+
57
+ * Update to [v4.1.0 definitions](https://github.com/holidays/definitions/releases/tag/v4.1.0). Please see the changelog for the definition details.
58
+
59
+ ## 7.0.0
60
+
61
+ Major semver bump due to the major version change in the [definitions](https://github.com/holidays/definitions/blob/master/CHANGELOG.md#400). Several non ISO regions have been modified in order to provide more clarity for parent and sub-regions.
62
+
63
+ Affected regions:
64
+
65
+ * `ecb_target` region changed to `ecbtarget`
66
+ * `federal_reserve` region changed to `federalreserve`
67
+ * `federalreservebanks` region changed to `federalreservebanks`
68
+ * `north_america_informal` region changed to `northamericainformal`
69
+ * `united_nations` region changed to `unitednations`
70
+ * `north_america` region changed to `northamerica`
71
+ * `south_america` region changed to `southamerica`
72
+
73
+ Please see the [definitions v4.0.0 CHANGELOG](https://github.com/holidays/definitions/blob/master/CHANGELOG.md#400) for the full change list.
74
+
3
75
  ## 6.6.1
4
76
 
5
77
  * Fixes `any_holidays_during_work_week?` so that it actually does what it says it does [issue-264](https://github.com/holidays/holidays/issues/264)
data/README.md CHANGED
@@ -14,11 +14,15 @@ gem install holidays
14
14
 
15
15
  This gem is tested with the following ruby versions:
16
16
 
17
- * 2.2.0
18
- * 2.3.0,
19
- * 2.4.0
20
- * 2.5.0
21
- * JRuby 9.0.5.0
17
+ * 2.4.5
18
+ * 2.5.3
19
+ * 2.6.1
20
+ * 2.7.7
21
+ * 3.0.6
22
+ * 3.1.4
23
+ * 3.2.2
24
+ * JRuby 9.2.21.0
25
+ * JRuby 9.4.2.0
22
26
 
23
27
  ## Semver
24
28
 
@@ -136,7 +140,7 @@ Get all observed US Federal holidays between 2018 and 2019:
136
140
  from = Date.civil(2018,1,1)
137
141
  to = Date.civil(2019,12,31)
138
142
 
139
- Holidays.between(from, to, :federal_reserve, :observed)
143
+ Holidays.between(from, to, :federalreserve, :observed)
140
144
  => [{:name => "New Year's Day"....}
141
145
  {:name => "Birthday of Martin Luther King, Jr"....}]
142
146
  ```
data/doc/CONTRIBUTING.md CHANGED
@@ -51,7 +51,7 @@ make point-to-defs-master
51
51
  ## For non-definition functionality
52
52
 
53
53
  * Fork this repository
54
- * Make your changes
54
+ * Make your changes. Don't forget to run `make test` to execute the test suite!
55
55
  * Create a PR pointing back to `master`
56
56
 
57
57
  Don't worry about versioning, we'll handle it on our end.
@@ -63,6 +63,7 @@ Don't worry about versioning, we'll handle it on our end.
63
63
  We have included a few handy tasks to help you troubleshoot and test:
64
64
 
65
65
  * `make test` - runs the entire suite
66
+ * `bundle exec ruby <test-file-to-run>` - runs just the tests in the specified file
66
67
  * `REGION=<region> make test-region` - runs the tests for just that region
67
68
  * `make console` - launches an IRB session with the 'holidays' gem loaded for quick testing
68
69
  * `make update-defs` - runs the appropriate git submodule commands to pull the latest definitions
data/holidays.gemspec CHANGED
@@ -16,11 +16,11 @@ Gem::Specification.new do |gem|
16
16
  gem.test_files = gem.files.grep(/^test/)
17
17
  gem.require_paths = ['lib']
18
18
  gem.licenses = ['MIT']
19
- gem.required_ruby_version = '~> 2.2'
20
- gem.add_development_dependency 'bundler', '~> 1.16'
19
+ gem.required_ruby_version = '>= 2.4'
20
+ gem.add_development_dependency 'bundler', '~> 2'
21
21
  gem.add_development_dependency 'rake', '~> 12'
22
22
  gem.add_development_dependency 'simplecov', '~> 0.16'
23
- gem.add_development_dependency 'test-unit', '~> 3.2'
24
- gem.add_development_dependency 'mocha', '~> 1.7'
25
- gem.add_development_dependency 'pry', '~> 0.11'
23
+ gem.add_development_dependency 'test-unit', '~> 3'
24
+ gem.add_development_dependency 'mocha', '~> 1'
25
+ gem.add_development_dependency 'pry', '~> 0.12'
26
26
  end
@@ -18,12 +18,13 @@ The following definition files are included in this installation:
18
18
  * generated_definitions/cz
19
19
  * generated_definitions/de
20
20
  * generated_definitions/dk
21
- * generated_definitions/ecb_target
21
+ * generated_definitions/ecbtarget
22
22
  * generated_definitions/ee
23
23
  * generated_definitions/el
24
24
  * generated_definitions/es
25
25
  * generated_definitions/europe
26
- * generated_definitions/federal_reserve
26
+ * generated_definitions/federalreserve
27
+ * generated_definitions/federalreservebanks
27
28
  * generated_definitions/fedex
28
29
  * generated_definitions/fi
29
30
  * generated_definitions/fr
@@ -37,18 +38,21 @@ The following definition files are included in this installation:
37
38
  * generated_definitions/it
38
39
  * generated_definitions/jp
39
40
  * generated_definitions/kr
41
+ * generated_definitions/kz
40
42
  * generated_definitions/li
41
43
  * generated_definitions/lt
42
44
  * generated_definitions/lu
45
+ * generated_definitions/lv
43
46
  * generated_definitions/ma
44
47
  * generated_definitions/mt_en
45
48
  * generated_definitions/mt_mt
46
49
  * generated_definitions/mx
47
50
  * generated_definitions/my
48
51
  * generated_definitions/nerc
52
+ * generated_definitions/ng
49
53
  * generated_definitions/nl
50
54
  * generated_definitions/no
51
- * generated_definitions/north_america
55
+ * generated_definitions/northamerica
52
56
  * generated_definitions/nyse
53
57
  * generated_definitions/nz
54
58
  * generated_definitions/pe
@@ -64,10 +68,12 @@ The following definition files are included in this installation:
64
68
  * generated_definitions/sg
65
69
  * generated_definitions/si
66
70
  * generated_definitions/sk
67
- * generated_definitions/south_america
71
+ * generated_definitions/southamerica
72
+ * generated_definitions/th
68
73
  * generated_definitions/tn
69
74
  * generated_definitions/tr
70
- * generated_definitions/united_nations
75
+ * generated_definitions/ua
76
+ * generated_definitions/unitednations
71
77
  * generated_definitions/ups
72
78
  * generated_definitions/us
73
79
  * generated_definitions/ve
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Holidays
3
- REGIONS = [:ar, :at, :au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_wa, :au_tas, :au_tas_south, :au_qld_cairns, :au_qld_brisbane, :au_tas_north, :au_vic_melbourne, :be_fr, :be_nl, :br, :bg_en, :bg_bg, :ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_nb, :ca_mb, :ca_ns, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_yt, :us, :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, :ch_vs, :ch, :cl, :co, :cr, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_sorbian, :de_th_cath, :de_sn, :de_st, :de_by_cath, :de_by_augsburg, :de_bb, :de_mv, :de_th, :de_hb, :de_hh, :de_ni, :de_sh, :ecb_target, :ee, :el, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :federal_reserve, :fedex, :fi, :fr_a, :fr_m, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :je, :gb_jsy, :gg, :gb_gsy, :gb_sct, :gb_con, :im, :gb_iom, :ge, :hr, :hk, :hu, :ie, :is, :it, :kr, :li, :lt, :ma, :mt_mt, :mt_en, :mx, :mx_pue, :nerc, :nl, :lu, :no, :nyse, :nz, :nz_sl, :nz_we, :nz_ak, :nz_nl, :nz_ne, :nz_ot, :nz_ta, :nz_sc, :nz_hb, :nz_mb, :nz_ca, :nz_ch, :nz_wl, :pe, :ph, :pl, :pt, :pt_li, :pt_po, :ro, :rs_cyrl, :rs_la, :ru, :se, :tn, :tr, :us_fl, :us_la, :us_ct, :us_de, :us_gu, :us_hi, :us_in, :us_ky, :us_nj, :us_nc, :us_nd, :us_pr, :us_tn, :us_ms, :us_id, :us_ar, :us_tx, :us_dc, :us_md, :us_va, :us_il, :us_vt, :us_ak, :us_ca, :us_me, :us_ma, :us_al, :us_ga, :us_ne, :us_mo, :us_sc, :us_wv, :us_vi, :us_ut, :us_ri, :us_az, :us_co, :us_mt, :us_nm, :us_ny, :us_oh, :us_pa, :us_mi, :us_mn, :us_nv, :us_or, :us_sd, :us_wa, :us_wi, :us_wy, :us_ia, :us_ks, :us_nh, :us_ok, :united_nations, :ups, :za, :ve, :sk, :si, :jp, :vi, :sg, :my]
3
+ REGIONS = [:ar, :at, :au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_wa, :au_tas, :au_tas_south, :au_qld_cairns, :au_qld_brisbane, :au_tas_north, :au_vic_melbourne, :be_fr, :be_nl, :br, :bg_en, :bg_bg, :ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_nb, :ca_mb, :ca_ns, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_yt, :us, :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, :ch_vs, :ch, :cl, :co, :cr, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_sorbian, :de_th_cath, :de_sn, :de_st, :de_be, :de_mv, :de_by_cath, :de_by_augsburg, :de_bb, :de_th, :de_hb, :de_hh, :de_ni, :de_sh, :ecbtarget, :ee, :el, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :federalreserve, :federalreservebanks, :fedex, :fi, :fr_a, :fr_m, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :je, :gb_jsy, :gg, :gb_gsy, :gb_sct, :gb_con, :im, :gb_iom, :ge, :hr, :hk, :hu, :ie, :is, :it, :it_ve, :it_tv, :it_vr, :it_pd, :it_fi, :it_ge, :it_to, :it_rm, :it_vi, :it_bl, :it_ro, :kr, :kz, :li, :lt, :lv, :ma, :mt_mt, :mt_en, :mx, :mx_pue, :nerc, :nl, :lu, :no, :nyse, :nz, :nz_sl, :nz_we, :nz_ak, :nz_nl, :nz_ne, :nz_ot, :nz_ta, :nz_sc, :nz_hb, :nz_mb, :nz_ca, :nz_ch, :nz_wl, :pe, :ph, :pl, :pt, :pt_li, :pt_po, :ro, :rs_cyrl, :rs_la, :ru, :se, :tn, :tr, :ua, :us_fl, :us_la, :us_ct, :us_de, :us_gu, :us_hi, :us_in, :us_ky, :us_nj, :us_nc, :us_nd, :us_pr, :us_tn, :us_ms, :us_id, :us_ar, :us_tx, :us_dc, :us_md, :us_va, :us_vt, :us_ak, :us_ca, :us_me, :us_ma, :us_al, :us_ga, :us_ne, :us_mo, :us_sc, :us_wv, :us_vi, :us_ut, :us_ri, :us_az, :us_co, :us_il, :us_mt, :us_nm, :us_ny, :us_oh, :us_pa, :us_mi, :us_mn, :us_nv, :us_or, :us_sd, :us_wa, :us_wi, :us_wy, :us_ia, :us_ks, :us_nh, :us_ok, :unitednations, :ups, :za, :ve, :sk, :si, :jp, :vi, :sg, :my, :th, :ng]
4
4
 
5
- PARENT_REGION_LOOKUP = {:ar=>:ar, :at=>:at, :au=>:au, :au_nsw=>:au, :au_vic=>:au, :au_qld=>:au, :au_nt=>:au, :au_act=>:au, :au_sa=>:au, :au_wa=>:au, :au_tas=>:au, :au_tas_south=>:au, :au_qld_cairns=>:au, :au_qld_brisbane=>:au, :au_tas_north=>:au, :au_vic_melbourne=>:au, :be_fr=>:be_fr, :be_nl=>:be_nl, :br=>:br, :bg_en=>:bg, :bg_bg=>:bg, :ca=>:ca, :ca_qc=>:ca, :ca_ab=>:ca, :ca_sk=>:ca, :ca_on=>:ca, :ca_bc=>:ca, :ca_nb=>:ca, :ca_mb=>:ca, :ca_ns=>:ca, :ca_pe=>:ca, :ca_nl=>:ca, :ca_nt=>:ca, :ca_nu=>:ca, :ca_yt=>:ca, :us=>:us, :ch_zh=>:ch, :ch_be=>:ch, :ch_lu=>:ch, :ch_ur=>:ch, :ch_sz=>:ch, :ch_ow=>:ch, :ch_nw=>:ch, :ch_gl=>:ch, :ch_zg=>:ch, :ch_fr=>:ch, :ch_so=>:ch, :ch_bs=>:ch, :ch_bl=>:ch, :ch_sh=>:ch, :ch_ar=>:ch, :ch_ai=>:ch, :ch_sg=>:ch, :ch_gr=>:ch, :ch_ag=>:ch, :ch_tg=>:ch, :ch_ti=>:ch, :ch_vd=>:ch, :ch_ne=>:ch, :ch_ge=>:ch, :ch_ju=>:ch, :ch_vs=>:ch, :ch=>:ch, :cl=>:cl, :co=>:co, :cr=>:cr, :cz=>:cz, :dk=>:dk, :de=>:de, :de_bw=>:de, :de_by=>:de, :de_he=>:de, :de_nw=>:de, :de_rp=>:de, :de_sl=>:de, :de_sn_sorbian=>:de, :de_th_cath=>:de, :de_sn=>:de, :de_st=>:de, :de_by_cath=>:de, :de_by_augsburg=>:de, :de_bb=>:de, :de_mv=>:de, :de_th=>:de, :de_hb=>:de, :de_hh=>:de, :de_ni=>:de, :de_sh=>:de, :ecb_target=>:ecb_target, :ee=>:ee, :el=>:el, :es_pv=>:es, :es_na=>:es, :es_an=>:es, :es_ib=>:es, :es_cm=>:es, :es_mu=>:es, :es_m=>:es, :es_ar=>:es, :es_cl=>:es, :es_cn=>:es, :es_lo=>:es, :es_ga=>:es, :es_ce=>:es, :es_o=>:es, :es_ex=>:es, :es=>:es, :es_ct=>:es, :es_v=>:es, :es_vc=>:es, :federal_reserve=>:federal_reserve, :fedex=>:fedex, :fi=>:fi, :fr_a=>:fr, :fr_m=>:fr, :fr=>:fr, :gb=>:gb, :gb_eng=>:gb, :gb_wls=>:gb, :gb_eaw=>:gb, :gb_nir=>:gb, :je=>:gb, :gb_jsy=>:gb, :gg=>:gb, :gb_gsy=>:gb, :gb_sct=>:gb, :gb_con=>:gb, :im=>:gb, :gb_iom=>:gb, :ge=>:ge, :hr=>:hr, :hk=>:hk, :hu=>:hu, :ie=>:ie, :is=>:is, :it=>:it, :kr=>:kr, :li=>:li, :lt=>:lt, :ma=>:ma, :mt_mt=>:mt_mt, :mt_en=>:mt_en, :mx=>:mx, :mx_pue=>:mx, :nerc=>:nerc, :nl=>:nl, :lu=>:lu, :no=>:no, :nyse=>:nyse, :nz=>:nz, :nz_sl=>:nz, :nz_we=>:nz, :nz_ak=>:nz, :nz_nl=>:nz, :nz_ne=>:nz, :nz_ot=>:nz, :nz_ta=>:nz, :nz_sc=>:nz, :nz_hb=>:nz, :nz_mb=>:nz, :nz_ca=>:nz, :nz_ch=>:nz, :nz_wl=>:nz, :pe=>:pe, :ph=>:ph, :pl=>:pl, :pt=>:pt, :pt_li=>:pt, :pt_po=>:pt, :ro=>:ro, :rs_cyrl=>:rs_cyrl, :rs_la=>:rs_la, :ru=>:ru, :se=>:se, :tn=>:tn, :tr=>:tr, :us_fl=>:us, :us_la=>:us, :us_ct=>:us, :us_de=>:us, :us_gu=>:us, :us_hi=>:us, :us_in=>:us, :us_ky=>:us, :us_nj=>:us, :us_nc=>:us, :us_nd=>:us, :us_pr=>:us, :us_tn=>:us, :us_ms=>:us, :us_id=>:us, :us_ar=>:us, :us_tx=>:us, :us_dc=>:us, :us_md=>:us, :us_va=>:us, :us_il=>:us, :us_vt=>:us, :us_ak=>:us, :us_ca=>:us, :us_me=>:us, :us_ma=>:us, :us_al=>:us, :us_ga=>:us, :us_ne=>:us, :us_mo=>:us, :us_sc=>:us, :us_wv=>:us, :us_vi=>:us, :us_ut=>:us, :us_ri=>:us, :us_az=>:us, :us_co=>:us, :us_mt=>:us, :us_nm=>:us, :us_ny=>:us, :us_oh=>:us, :us_pa=>:us, :us_mi=>:us, :us_mn=>:us, :us_nv=>:us, :us_or=>:us, :us_sd=>:us, :us_wa=>:us, :us_wi=>:us, :us_wy=>:us, :us_ia=>:us, :us_ks=>:us, :us_nh=>:us, :us_ok=>:us, :united_nations=>:united_nations, :ups=>:ups, :za=>:za, :ve=>:south_america, :sk=>:europe, :si=>:europe, :jp=>:jp, :vi=>:vi, :sg=>:sg, :my=>:my}
5
+ PARENT_REGION_LOOKUP = {:ar=>:ar, :at=>:at, :au=>:au, :au_nsw=>:au, :au_vic=>:au, :au_qld=>:au, :au_nt=>:au, :au_act=>:au, :au_sa=>:au, :au_wa=>:au, :au_tas=>:au, :au_tas_south=>:au, :au_qld_cairns=>:au, :au_qld_brisbane=>:au, :au_tas_north=>:au, :au_vic_melbourne=>:au, :be_fr=>:be_fr, :be_nl=>:be_nl, :br=>:br, :bg_en=>:bg, :bg_bg=>:bg, :ca=>:ca, :ca_qc=>:ca, :ca_ab=>:ca, :ca_sk=>:ca, :ca_on=>:ca, :ca_bc=>:ca, :ca_nb=>:ca, :ca_mb=>:ca, :ca_ns=>:ca, :ca_pe=>:ca, :ca_nl=>:ca, :ca_nt=>:ca, :ca_nu=>:ca, :ca_yt=>:ca, :us=>:us, :ch_zh=>:ch, :ch_be=>:ch, :ch_lu=>:ch, :ch_ur=>:ch, :ch_sz=>:ch, :ch_ow=>:ch, :ch_nw=>:ch, :ch_gl=>:ch, :ch_zg=>:ch, :ch_fr=>:ch, :ch_so=>:ch, :ch_bs=>:ch, :ch_bl=>:ch, :ch_sh=>:ch, :ch_ar=>:ch, :ch_ai=>:ch, :ch_sg=>:ch, :ch_gr=>:ch, :ch_ag=>:ch, :ch_tg=>:ch, :ch_ti=>:ch, :ch_vd=>:ch, :ch_ne=>:ch, :ch_ge=>:ch, :ch_ju=>:ch, :ch_vs=>:ch, :ch=>:ch, :cl=>:cl, :co=>:co, :cr=>:cr, :cz=>:cz, :dk=>:dk, :de=>:de, :de_bw=>:de, :de_by=>:de, :de_he=>:de, :de_nw=>:de, :de_rp=>:de, :de_sl=>:de, :de_sn_sorbian=>:de, :de_th_cath=>:de, :de_sn=>:de, :de_st=>:de, :de_be=>:de, :de_mv=>:de, :de_by_cath=>:de, :de_by_augsburg=>:de, :de_bb=>:de, :de_th=>:de, :de_hb=>:de, :de_hh=>:de, :de_ni=>:de, :de_sh=>:de, :ecbtarget=>:ecbtarget, :ee=>:ee, :el=>:el, :es_pv=>:es, :es_na=>:es, :es_an=>:es, :es_ib=>:es, :es_cm=>:es, :es_mu=>:es, :es_m=>:es, :es_ar=>:es, :es_cl=>:es, :es_cn=>:es, :es_lo=>:es, :es_ga=>:es, :es_ce=>:es, :es_o=>:es, :es_ex=>:es, :es=>:es, :es_ct=>:es, :es_v=>:es, :es_vc=>:es, :federalreserve=>:federalreserve, :federalreservebanks=>:federalreservebanks, :fedex=>:fedex, :fi=>:fi, :fr_a=>:fr, :fr_m=>:fr, :fr=>:fr, :gb=>:gb, :gb_eng=>:gb, :gb_wls=>:gb, :gb_eaw=>:gb, :gb_nir=>:gb, :je=>:gb, :gb_jsy=>:gb, :gg=>:gb, :gb_gsy=>:gb, :gb_sct=>:gb, :gb_con=>:gb, :im=>:gb, :gb_iom=>:gb, :ge=>:ge, :hr=>:hr, :hk=>:hk, :hu=>:hu, :ie=>:ie, :is=>:is, :it=>:it, :it_ve=>:it, :it_tv=>:it, :it_vr=>:it, :it_pd=>:it, :it_fi=>:it, :it_ge=>:it, :it_to=>:it, :it_rm=>:it, :it_vi=>:it, :it_bl=>:it, :it_ro=>:it, :kr=>:kr, :kz=>:kz, :li=>:li, :lt=>:lt, :lv=>:lv, :ma=>:ma, :mt_mt=>:mt_mt, :mt_en=>:mt_en, :mx=>:mx, :mx_pue=>:mx, :nerc=>:nerc, :nl=>:nl, :lu=>:lu, :no=>:no, :nyse=>:nyse, :nz=>:nz, :nz_sl=>:nz, :nz_we=>:nz, :nz_ak=>:nz, :nz_nl=>:nz, :nz_ne=>:nz, :nz_ot=>:nz, :nz_ta=>:nz, :nz_sc=>:nz, :nz_hb=>:nz, :nz_mb=>:nz, :nz_ca=>:nz, :nz_ch=>:nz, :nz_wl=>:nz, :pe=>:pe, :ph=>:ph, :pl=>:pl, :pt=>:pt, :pt_li=>:pt, :pt_po=>:pt, :ro=>:ro, :rs_cyrl=>:rs_cyrl, :rs_la=>:rs_la, :ru=>:ru, :se=>:se, :tn=>:tn, :tr=>:tr, :ua=>:ua, :us_fl=>:us, :us_la=>:us, :us_ct=>:us, :us_de=>:us, :us_gu=>:us, :us_hi=>:us, :us_in=>:us, :us_ky=>:us, :us_nj=>:us, :us_nc=>:us, :us_nd=>:us, :us_pr=>:us, :us_tn=>:us, :us_ms=>:us, :us_id=>:us, :us_ar=>:us, :us_tx=>:us, :us_dc=>:us, :us_md=>:us, :us_va=>:us, :us_vt=>:us, :us_ak=>:us, :us_ca=>:us, :us_me=>:us, :us_ma=>:us, :us_al=>:us, :us_ga=>:us, :us_ne=>:us, :us_mo=>:us, :us_sc=>:us, :us_wv=>:us, :us_vi=>:us, :us_ut=>:us, :us_ri=>:us, :us_az=>:us, :us_co=>:us, :us_il=>:us, :us_mt=>:us, :us_nm=>:us, :us_ny=>:us, :us_oh=>:us, :us_pa=>:us, :us_mi=>:us, :us_mn=>:us, :us_nv=>:us, :us_or=>:us, :us_sd=>:us, :us_wa=>:us, :us_wi=>:us, :us_wy=>:us, :us_ia=>:us, :us_ks=>:us, :us_nh=>:us, :us_ok=>:us, :unitednations=>:unitednations, :ups=>:ups, :za=>:za, :ve=>:southamerica, :sk=>:europe, :si=>:europe, :jp=>:jp, :vi=>:vi, :sg=>:sg, :my=>:my, :th=>:th, :ng=>:ng}
6
6
  end
@@ -12,29 +12,48 @@ module Holidays
12
12
 
13
13
  def self.holidays_by_month
14
14
  {
15
- 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Viernes Santo", :regions => [:ar]},
15
+ 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Viernes Santo", :regions => [:ar]},
16
16
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => -48, :name => "Carnaval Lunes", :regions => [:ar]},
17
17
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :name => "Carnaval Martes", :regions => [:ar]}],
18
18
  1 => [{:mday => 1, :name => "Año Nuevo", :regions => [:ar]}],
19
19
  3 => [{:mday => 24, :name => "Día Nacional de la Memoria por la Verdad y la Justicia", :regions => [:ar]}],
20
20
  4 => [{:mday => 2, :name => "Día del Veterano y de los Caídos en la Guerra de Malvinas", :regions => [:ar]}],
21
21
  5 => [{:mday => 1, :name => "Día del Trabajador", :regions => [:ar]},
22
- {:mday => 25, :name => "Día de la Revolución de Mayo", :regions => [:ar]}],
23
- 6 => [{:mday => 20, :name => "Día de la Bandera", :regions => [:ar]}],
24
- 7 => [{:mday => 8, :name => "Feriado puente turístico", :regions => [:ar]},
22
+ {:mday => 25, :name => "Día de la Revolución de Mayo", :regions => [:ar]},
23
+ {:mday => 24, :year_ranges => { :limited => [2021] },:name => "Feriado con fines turísticos", :regions => [:ar]}],
24
+ 6 => [{:mday => 17, :function => "to_nearest_monday(date)", :function_arguments => [:date], :name => "Paso a la Inmortalidad del General Martín Miguel de Güemes", :regions => [:ar]},
25
+ {:mday => 20, :name => "Día de la Bandera", :regions => [:ar]}],
26
+ 7 => [{:mday => 8, :year_ranges => { :limited => [2016] },:name => "Feriado con fines turísticos", :regions => [:ar]},
25
27
  {:mday => 9, :name => "Día de la Independencia", :regions => [:ar]}],
26
- 8 => [{:mday => 15, :name => "Paso a la Inmortalidad del General José de San Martín", :regions => [:ar]}],
27
- 10 => [{:mday => 12, :name => "Día del Respeto a la Diversidad Cultural", :regions => [:ar]}],
28
- 11 => [{:mday => 20, :name => "Día de la Soberanía Nacional", :regions => [:ar]}],
28
+ 8 => [{:mday => 17, :function => "to_nearest_monday(date)", :function_arguments => [:date], :name => "Paso a la Inmortalidad del General José de San Martín", :regions => [:ar]}],
29
+ 10 => [{:mday => 12, :function => "to_nearest_monday(date)", :function_arguments => [:date], :name => "Día del Respeto a la Diversidad Cultural", :regions => [:ar]},
30
+ {:mday => 8, :year_ranges => { :limited => [2021] },:name => "Feriado con fines turísticos", :regions => [:ar]}],
31
+ 11 => [{:mday => 20, :name => "Día de la Soberanía Nacional", :regions => [:ar]},
32
+ {:mday => 22, :year_ranges => { :limited => [2021] },:name => "Feriado con fines turísticos", :regions => [:ar]}],
29
33
  12 => [{:mday => 8, :name => "Inmaculada Concepción de María", :regions => [:ar]},
30
- {:mday => 9, :name => "Feriado puente turístico", :regions => [:ar]},
34
+ {:mday => 9, :year_ranges => { :limited => [2016] },:name => "Feriado con fines turísticos", :regions => [:ar]},
31
35
  {:mday => 25, :name => "Navidad", :regions => [:ar]}]
32
36
  }
33
37
  end
34
38
 
35
39
  def self.custom_methods
36
40
  {
37
-
41
+ "to_nearest_monday(date)" => Proc.new { |date|
42
+ case date.wday
43
+ when 5
44
+ date += 3
45
+ when 4
46
+ date += 4
47
+ when 3
48
+ date -= 2
49
+ when 2
50
+ date -= 1
51
+ end
52
+
53
+ date
54
+ },
55
+
56
+
38
57
  }
39
58
  end
40
59
  end
@@ -12,7 +12,7 @@ module Holidays
12
12
 
13
13
  def self.holidays_by_month
14
14
  {
15
- 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Ostermontag", :regions => [:at]},
15
+ 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Ostermontag", :regions => [:at]},
16
16
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 39, :name => "Christi Himmelfahrt", :regions => [:at]},
17
17
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 50, :name => "Pfingstmontag", :regions => [:at]},
18
18
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 60, :name => "Fronleichnam", :regions => [:at]}],
@@ -30,7 +30,7 @@ module Holidays
30
30
 
31
31
  def self.custom_methods
32
32
  {
33
-
33
+
34
34
  }
35
35
  end
36
36
  end
@@ -12,10 +12,10 @@ module Holidays
12
12
 
13
13
  def self.holidays_by_month
14
14
  {
15
- 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:au]},
15
+ 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:au]},
16
16
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Easter Saturday", :regions => [:au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa]},
17
17
  {:function => "easter(year)", :function_arguments => [:year], :name => "Easter Sunday", :regions => [:au_nsw, :au_vic]},
18
- {:function => "easter(year)", :function_arguments => [:year], :year_ranges => [{:after => 2017}],:name => "Easter Sunday", :regions => [:au_qld, :au_act]},
18
+ {:function => "easter(year)", :function_arguments => [:year], :year_ranges => { :from => 2017 },:name => "Easter Sunday", :regions => [:au_qld, :au_act]},
19
19
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Easter Monday", :regions => [:au]}],
20
20
  1 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:au, :au_nsw, :au_vic, :au_act, :au_sa, :au_wa, :au_nt, :au_qld]},
21
21
  {:mday => 1, :function => "to_monday_if_weekend(date)", :function_arguments => [:date], :name => "New Year's Day", :regions => [:au_tas]},
@@ -26,20 +26,22 @@ module Holidays
26
26
  {:wday => 1, :week => 2, :name => "Labour Day", :regions => [:au_vic]},
27
27
  {:function => "march_pub_hol_sa(year)", :function_arguments => [:year], :name => "March Public Holiday", :regions => [:au_sa]},
28
28
  {:wday => 1, :week => 2, :name => "Canberra Day", :regions => [:au_act]}],
29
- 4 => [{:mday => 25, :name => "ANZAC Day", :regions => [:au]},
30
- {:mday => 25, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "ANZAC Day", :regions => [:au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_tas]},
29
+ 4 => [{:mday => 25, :name => "ANZAC Day", :regions => [:au, :au_vic]},
30
+ {:mday => 25, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "ANZAC Day", :regions => [:au_nsw, :au_qld, :au_nt, :au_act, :au_sa, :au_tas]},
31
31
  {:mday => 25, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "ANZAC Day", :regions => [:au_wa]}],
32
32
  5 => [{:function => "qld_labour_day_may(year)", :function_arguments => [:year], :name => "Labour Day", :regions => [:au_qld]},
33
33
  {:wday => 1, :week => 1, :name => "May Day", :regions => [:au_nt]},
34
- {:function => "may_pub_hol_sa(year)", :function_arguments => [:year], :name => "May Public Holiday", :regions => [:au_sa]}],
35
- 6 => [{:wday => 1, :week => 1, :name => "Foundation Day", :regions => [:au_wa]},
34
+ {:function => "may_pub_hol_sa(year)", :function_arguments => [:year], :name => "May Public Holiday", :regions => [:au_sa]},
35
+ {:mday => 27, :function => "to_nearest_monday_after(date)", :function_arguments => [:date], :year_ranges => { :from => 2018 },:name => "Reconciliation Day", :regions => [:au_act]}],
36
+ 6 => [{:wday => 1, :week => 1, :name => "Western Australia Day", :regions => [:au_wa]},
36
37
  {:wday => 1, :week => 2, :name => "Queen's Birthday", :regions => [:au_act, :au_nsw, :au_sa, :au_tas, :au_nt, :au_vic]},
37
38
  {:function => "qld_queens_birthday_june(year)", :function_arguments => [:year], :name => "Queen's Birthday", :regions => [:au_qld]},
38
39
  {:mday => 6, :type => :informal, :name => "Queensland Day", :regions => [:au_qld]}],
39
40
  7 => [{:wday => 5, :week => 3, :name => "Cairns Show", :regions => [:au_qld_cairns]}],
40
- 8 => [{:wday => 3, :week => -3, :name => "Ekka", :regions => [:au_qld_brisbane]}],
41
- 9 => [{:wday => 1, :week => -1, :name => "Queen's Birthday", :regions => [:au_wa]},
42
- {:wday => 1, :week => -1, :name => "Family & Community Day", :regions => [:au_act]}],
41
+ 8 => [{:function => "qld_brisbane_ekka_holiday(year)", :function_arguments => [:year], :name => "Ekka", :regions => [:au_qld_brisbane]}],
42
+ 9 => [{:mday => 22, :year_ranges => { :limited => [2022] },:name => "National Day of Mourning for Her Majesty Queen Elizabeth II", :regions => [:au]},
43
+ {:wday => 1, :week => -1, :name => "Queen's Birthday", :regions => [:au_wa]},
44
+ {:wday => 1, :week => -1, :year_ranges => { :until => 2017 },:name => "Family & Community Day", :regions => [:au_act]}],
43
45
  10 => [{:function => "afl_grand_final(year)", :function_arguments => [:year], :name => "Friday before the AFL Grand Final", :regions => [:au_vic]},
44
46
  {:wday => 1, :week => 1, :name => "Labour Day", :regions => [:au_act, :au_nsw, :au_sa]},
45
47
  {:function => "qld_labour_day_october(year)", :function_arguments => [:year], :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Labour Day", :regions => [:au_qld]},
@@ -58,7 +60,7 @@ module Holidays
58
60
 
59
61
  def self.custom_methods
60
62
  {
61
- "afl_grand_final(year)" => Proc.new { |year|
63
+ "afl_grand_final(year)" => Proc.new { |year|
62
64
  case year
63
65
  when 2015
64
66
  Date.civil(2015, 10, 2)
@@ -66,6 +68,12 @@ when 2016
66
68
  Date.civil(2016, 9, 30)
67
69
  when 2017
68
70
  Date.civil(2017, 9, 29)
71
+ when 2018
72
+ Date.civil(2018, 9, 28)
73
+ when 2019
74
+ Date.civil(2019,9, 27)
75
+ when 2020
76
+ Date.civil(2020, 10, 23)
69
77
  end
70
78
  },
71
79
 
@@ -122,6 +130,35 @@ else
122
130
  end
123
131
  },
124
132
 
133
+ "qld_brisbane_ekka_holiday(year)" => Proc.new { |year|
134
+ first_friday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :first, :friday)
135
+
136
+ if first_friday < 5
137
+ second_friday = Date.civil(year, 8, Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 8, :second, :friday))
138
+ second_friday + 5 # The next Wednesday
139
+ else
140
+ Date.civil(year, 8, first_friday) + 5
141
+ end
142
+ },
143
+
144
+ "to_nearest_monday_after(date)" => Proc.new { |date|
145
+ case date.wday
146
+ when 6
147
+ date += 2
148
+ when 5
149
+ date += 3
150
+ when 4
151
+ date += 4
152
+ when 3
153
+ date += 5
154
+ when 2
155
+ date += 6
156
+ when 0
157
+ date += 1
158
+ end
159
+ date
160
+ },
161
+
125
162
 
126
163
  }
127
164
  end
@@ -12,7 +12,7 @@ module Holidays
12
12
 
13
13
  def self.holidays_by_month
14
14
  {
15
- 0 => [{:function => "easter(year)", :function_arguments => [:year], :name => "Pâques", :regions => [:be_fr]},
15
+ 0 => [{:function => "easter(year)", :function_arguments => [:year], :name => "Pâques", :regions => [:be_fr]},
16
16
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Lundi de Pâques", :regions => [:be_fr]},
17
17
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 39, :name => "Ascension", :regions => [:be_fr]},
18
18
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 49, :name => "Pentecôte", :regions => [:be_fr]},
@@ -29,7 +29,7 @@ module Holidays
29
29
 
30
30
  def self.custom_methods
31
31
  {
32
-
32
+
33
33
  }
34
34
  end
35
35
  end
@@ -12,7 +12,7 @@ module Holidays
12
12
 
13
13
  def self.holidays_by_month
14
14
  {
15
- 0 => [{:function => "easter(year)", :function_arguments => [:year], :name => "Pasen", :regions => [:be_nl]},
15
+ 0 => [{:function => "easter(year)", :function_arguments => [:year], :name => "Pasen", :regions => [:be_nl]},
16
16
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Paasmaandag", :regions => [:be_nl]},
17
17
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 39, :name => "O.H. Hemelvaart", :regions => [:be_nl]},
18
18
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 49, :name => "Pinksteren", :regions => [:be_nl]},
@@ -29,7 +29,7 @@ module Holidays
29
29
 
30
30
  def self.custom_methods
31
31
  {
32
-
32
+
33
33
  }
34
34
  end
35
35
  end
@@ -12,7 +12,7 @@ module Holidays
12
12
 
13
13
  def self.holidays_by_month
14
14
  {
15
- 0 => [{:function => "orthodox_easter_julian(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:bg_en]},
15
+ 0 => [{:function => "orthodox_easter_julian(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:bg_en]},
16
16
  {:function => "orthodox_easter_julian(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Разпети петък", :regions => [:bg_bg]},
17
17
  {:function => "orthodox_easter_julian(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Holy Saturday", :regions => [:bg_en]},
18
18
  {:function => "orthodox_easter_julian(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Велика събота", :regions => [:bg_bg]},
@@ -46,7 +46,7 @@ module Holidays
46
46
 
47
47
  def self.custom_methods
48
48
  {
49
-
49
+
50
50
  }
51
51
  end
52
52
  end
@@ -12,7 +12,7 @@ module Holidays
12
12
 
13
13
  def self.holidays_by_month
14
14
  {
15
- 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :type => :informal, :name => "Carnaval", :regions => [:br]},
15
+ 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -47, :type => :informal, :name => "Carnaval", :regions => [:br]},
16
16
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Sexta-feira Santa", :regions => [:br]},
17
17
  {:function => "easter(year)", :function_arguments => [:year], :name => "Páscoa", :regions => [:br]},
18
18
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 60, :name => "Corpus Christi", :regions => [:br]}],
@@ -29,7 +29,7 @@ module Holidays
29
29
 
30
30
  def self.custom_methods
31
31
  {
32
-
32
+
33
33
  }
34
34
  end
35
35
  end
@@ -2,7 +2,7 @@
2
2
  module Holidays
3
3
  # This file is generated by the Ruby Holidays gem.
4
4
  #
5
- # Definitions loaded: definitions/ca.yaml, definitions/north_america_informal.yaml
5
+ # Definitions loaded: definitions/ca.yaml, definitions/northamericainformal.yaml
6
6
  #
7
7
  # All the definitions are available at https://github.com/holidays/holidays
8
8
  module CA # :nodoc:
@@ -12,22 +12,24 @@ module Holidays
12
12
 
13
13
  def self.holidays_by_month
14
14
  {
15
- 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:ca]},
15
+ 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Good Friday", :regions => [:ca]},
16
16
  {:function => "easter(year)", :function_arguments => [:year], :type => :informal, :name => "Easter Sunday", :regions => [:ca]},
17
17
  {:function => "easter(year)", :function_arguments => [:year], :function_modifier => 1, :type => :informal, :name => "Easter Monday", :regions => [:ca]}],
18
18
  1 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "New Year's Day", :regions => [:ca]},
19
19
  {:mday => 2, :name => "New Year's", :regions => [:ca_qc]}],
20
- 2 => [{:wday => 1, :week => 3, :year_ranges => [{:after => 1990}],:name => "Family Day", :regions => [:ca_ab]},
21
- {:wday => 1, :week => 3, :year_ranges => [{:after => 2007}],:name => "Family Day", :regions => [:ca_sk]},
22
- {:wday => 1, :week => 3, :year_ranges => [{:after => 2008}],:name => "Family Day", :regions => [:ca_on]},
23
- {:wday => 1, :week => 2, :year_ranges => [{:after => 2013}],:name => "Family Day", :regions => [:ca_bc]},
24
- {:wday => 1, :week => 3, :year_ranges => [{:after => 2018}],:name => "Family Day", :regions => [:ca_nb]},
20
+ 2 => [{:wday => 1, :week => 3, :year_ranges => { :from => 1990 },:name => "Family Day", :regions => [:ca_ab]},
21
+ {:wday => 1, :week => 3, :year_ranges => { :from => 2007 },:name => "Family Day", :regions => [:ca_sk]},
22
+ {:wday => 1, :week => 3, :year_ranges => { :from => 2008 },:name => "Family Day", :regions => [:ca_on]},
23
+ {:wday => 1, :week => 2, :year_ranges => { :between => 2013..2018 },:name => "Family Day", :regions => [:ca_bc]},
24
+ {:wday => 1, :week => 3, :year_ranges => { :from => 2019 },:name => "Family Day", :regions => [:ca_bc]},
25
+ {:wday => 1, :week => 3, :year_ranges => { :from => 2018 },:name => "Family Day", :regions => [:ca_nb]},
25
26
  {:wday => 1, :week => 3, :name => "Louis Riel Day", :regions => [:ca_mb]},
26
- {:wday => 1, :week => 3, :year_ranges => [{:after => 2015}],:name => "Nova Scotia Heritage Day", :regions => [:ca_ns]},
27
+ {:wday => 1, :week => 3, :year_ranges => { :from => 2015 },:name => "Nova Scotia Heritage Day", :regions => [:ca_ns]},
27
28
  {:wday => 1, :week => 3, :name => "Islander Day", :regions => [:ca_pe]},
28
29
  {:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
29
30
  {:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
30
- 3 => [{:mday => 23, :type => :informal, :name => "St. George's Day", :regions => [:ca_nl]},
31
+ 3 => [{:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:ca_nl]},
32
+ {:mday => 23, :type => :informal, :name => "St. George's Day", :regions => [:ca_nl]},
31
33
  {:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
32
34
  5 => [{:function => "ca_victoria_day(year)", :function_arguments => [:year], :name => "Victoria Day", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt]},
33
35
  {:function => "ca_victoria_day(year)", :function_arguments => [:year], :name => "National Patriotes Day", :regions => [:ca_qc]},
@@ -36,11 +38,11 @@ module Holidays
36
38
  6 => [{:mday => 24, :type => :informal, :name => "Discovery Day", :regions => [:ca_nl]},
37
39
  {:mday => 24, :name => "Fête Nationale", :regions => [:ca_qc]},
38
40
  {:mday => 21, :name => "National Aboriginal Day", :regions => [:ca_nt]},
39
- {:mday => 21, :year_ranges => [{:after => 2017}],:name => "National Aboriginal Day", :regions => [:ca_yt]},
41
+ {:mday => 21, :year_ranges => { :from => 2017 },:name => "National Aboriginal Day", :regions => [:ca_yt]},
40
42
  {:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
41
43
  7 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Canada Day", :regions => [:ca]},
42
44
  {:mday => 12, :type => :informal, :name => "Orangemen's Day", :regions => [:ca_nl]},
43
- {:mday => 9, :name => "Nunavut Day", :regions => [:ca_nu]}],
45
+ {:mday => 9, :year_ranges => { :from => 2020 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Nunavut Day", :regions => [:ca_nu]}],
44
46
  8 => [{:wday => 1, :week => 1, :name => "B.C. Day", :regions => [:ca_bc]},
45
47
  {:wday => 1, :week => 1, :name => "Saskatchewan Day", :regions => [:ca_sk]},
46
48
  {:wday => 1, :week => 1, :type => :informal, :name => "Heritage Day", :regions => [:ca_ab]},
@@ -48,14 +50,20 @@ module Holidays
48
50
  {:wday => 1, :week => 1, :name => "Civic Holiday", :regions => [:ca_nt, :ca_nu]},
49
51
  {:wday => 1, :week => 1, :type => :informal, :name => "Civic Holiday", :regions => [:ca_on, :ca_pe]},
50
52
  {:wday => 1, :week => 1, :name => "New Brunswick Day", :regions => [:ca_nb]},
53
+ {:wday => 1, :week => 1, :type => :informal, :name => "Terry Fox Day", :regions => [:ca_mb]},
51
54
  {:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:ca_yt]}],
52
- 9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]}],
53
- 10 => [{:wday => 1, :week => 2, :name => "Thanksgiving", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt]},
55
+ 9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]},
56
+ {:mday => 30, :year_ranges => { :from => 2021 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "National Day for Truth and Reconciliation", :regions => [:ca_bc, :ca_nt, :ca_pe, :ca_yt]},
57
+ {:mday => 30, :year_ranges => { :from => 2021 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :type => :informal, :name => "National Day for Truth and Reconciliation", :regions => [:ca_ab, :ca_mb, :ca_nu]}],
58
+ 10 => [{:wday => 1, :week => 2, :name => "Thanksgiving", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_qc, :ca_sk, :ca_yt]},
54
59
  {:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
55
60
  11 => [{:mday => 11, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Remembrance Day", :regions => [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt]}],
56
- 12 => [{:mday => 25, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ca]},
57
- {:mday => 26, :observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:ca_on]},
58
- {:mday => 26, :observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :type => :informal, :name => "Boxing Day", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nb, :ca_nl, :ca_nt, :ca_ns, :ca_nu, :ca_pe, :ca_sk, :ca_yt]}],
61
+ 12 => [{:mday => 25, :year_ranges => { :until => 2020 },:observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ca_on]},
62
+ {:mday => 25, :year_ranges => { :from => 2020 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ca_on]},
63
+ {:mday => 25, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nb, :ca_nl, :ca_nt, :ca_ns, :ca_nu, :ca_pe, :ca_qc, :ca_sk, :ca_yt]},
64
+ {:mday => 26, :year_ranges => { :until => 2020 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:ca_on]},
65
+ {:mday => 26, :year_ranges => { :from => 2020 },:observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:ca_on]},
66
+ {:mday => 26, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :type => :informal, :name => "Boxing Day", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nb, :ca_nl, :ca_nt, :ca_ns, :ca_nu, :ca_pe, :ca_qc, :ca_sk, :ca_yt]}],
59
67
  4 => [{:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
60
68
  {:mday => 22, :type => :informal, :name => "Earth Day", :regions => [:us, :ca]}]
61
69
  }
@@ -63,7 +71,7 @@ module Holidays
63
71
 
64
72
  def self.custom_methods
65
73
  {
66
- "ca_victoria_day(year)" => Proc.new { |year|
74
+ "ca_victoria_day(year)" => Proc.new { |year|
67
75
  date = Date.civil(year,5,24)
68
76
  if date.wday > 1
69
77
  date -= (date.wday - 1)