holidays 5.2.1 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +3 -0
- data/lib/generated_definitions/REGIONS.rb +1 -1
- data/lib/generated_definitions/ca.rb +6 -6
- data/lib/generated_definitions/north_america.rb +6 -6
- data/lib/holidays/version.rb +1 -1
- data/test/defs/test_defs_ca.rb +2 -2
- data/test/defs/test_defs_north_america.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30377dc9e9355e6b5b752a770530f5ad512673b6
|
4
|
+
data.tar.gz: 7426948bcbcbe2c9f3c86eccb80a7291717b742f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca4ca5bd5ba71eafdedc24a72d47d8c8804c96757e78a95159c2ac2325fb5f9322763b992fdd1db701d67ebe49be598d73abaf7c27d9deff993dab0dbb124ea4
|
7
|
+
data.tar.gz: 050b4d862d71ac3dc95e074e354cdbd49d614127cbeaa1070e52082d553b9159fcdfdc4625af7643104a8240a15edc1341ccd21f9d2ffa78b4f9f2369935cb18
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Ruby Holidays Gem CHANGELOG
|
2
2
|
|
3
|
+
## 5.3.0
|
4
|
+
|
5
|
+
* Fix `ca` province/territory codes for 'Newfoundland and Labrador' and 'Yukon' (thanks to https://github.com/slucaskim)
|
6
|
+
|
3
7
|
## 5.2.1
|
4
8
|
|
5
9
|
* Fix caching (i.e. calls to `cache_between`) to...you know, actually cache correctly and give
|
data/README.md
CHANGED
@@ -18,6 +18,9 @@ This gem follows [semantic versioning](http://semver.org/). The only methods cov
|
|
18
18
|
`Holidays` namespace specifically. Anything that is not a method off of `Holidays` or the core extension is not covered by
|
19
19
|
semver. Please take this into account when relying on this gem as a dependency.
|
20
20
|
|
21
|
+
Also note that we consider definition changes as 'minor' bumps, meaning they are backwards compatible with your code
|
22
|
+
but might give different holiday results! Please note this when relying on this gem.
|
23
|
+
|
21
24
|
## Time zones
|
22
25
|
|
23
26
|
Time zones are ignored. This library assumes that all dates are within the same time zone.
|
@@ -1,4 +1,4 @@
|
|
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_tas_south, :au_wa, :au_tas, :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_mb, :ca_ns, :ca_pe, :
|
3
|
+
REGIONS = [:ar, :at, :au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_tas_south, :au_wa, :au_tas, :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_mb, :ca_ns, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :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, :cr, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_aux, :de_th_aux, :de_sn, :de_st, :de_by_aux, :de_bb, :de_mv, :de_th, :ecb_target, :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, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :hr, :hk, :hu, :ie, :is, :it, :kr, :li, :lt, :ma, :mx, :mx_pue, :us, :ca, :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, :ro, :se, :us, :us_dc, :us_ca, :ca, :united_nations, :ups, :za, :ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_mb, :ca_ns, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt, :mx, :mx_pue, :us, :us_dc, :us_ca, :dk, :is, :no, :se, :fi, :at, :be_fr, :be_nl, :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, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_aux, :de_th_aux, :de_sn, :de_st, :de_by_aux, :de_bb, :de_mv, :de_th, :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, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :hr, :hu, :ie, :is, :it, :li, :lt, :nl, :no, :pl, :pt, :ro, :sk, :si, :bg_en, :bg_bg, :jp, :ve, :vi, :sk, :si, :sg, :my]
|
4
4
|
end
|
@@ -13,7 +13,7 @@ module Holidays
|
|
13
13
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
14
|
module CA # :nodoc:
|
15
15
|
def self.defined_regions
|
16
|
-
[:ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_mb, :ca_ns, :ca_pe, :
|
16
|
+
[:ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_mb, :ca_ns, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt, :us]
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.holidays_by_month
|
@@ -32,18 +32,18 @@ module Holidays
|
|
32
32
|
{:wday => 1, :week => 3, :name => "Islander Day", :regions => [:ca_pe]},
|
33
33
|
{:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
|
34
34
|
{:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
|
35
|
-
3 => [{:mday => 23, :name => "St. George's Day", :regions => [:
|
35
|
+
3 => [{:mday => 23, :name => "St. George's Day", :regions => [:ca_nl]},
|
36
36
|
{:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
|
37
37
|
5 => [{:function => "ca_victoria_day(year)", :function_arguments => [:year], :name => "Victoria Day", :regions => [:ca]},
|
38
38
|
{:function => "ca_victoria_day(year)", :function_arguments => [:year], :name => "National Patriotes Day", :regions => [:ca_qc]},
|
39
39
|
{:wday => 0, :week => 2, :type => :informal, :name => "Mother's Day", :regions => [:us, :ca]},
|
40
40
|
{:wday => 6, :week => 3, :type => :informal, :name => "Armed Forces Day", :regions => [:us]}],
|
41
|
-
6 => [{:mday => 24, :name => "Discovery Day", :regions => [:
|
41
|
+
6 => [{:mday => 24, :name => "Discovery Day", :regions => [:ca_nl]},
|
42
42
|
{:mday => 24, :name => "Fête Nationale", :regions => [:ca_qc]},
|
43
43
|
{:mday => 21, :name => "National Aboriginal Day", :regions => [:ca_nt]},
|
44
44
|
{:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
|
45
45
|
7 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Canada Day", :regions => [:ca]},
|
46
|
-
{:mday => 12, :name => "Orangemen's Day", :regions => [:
|
46
|
+
{:mday => 12, :name => "Orangemen's Day", :regions => [:ca_nl]},
|
47
47
|
{:mday => 9, :name => "Nunavut Day", :regions => [:ca_nu]}],
|
48
48
|
8 => [{:wday => 1, :week => 1, :name => "BC Day", :regions => [:ca_bc]},
|
49
49
|
{:wday => 1, :week => 1, :name => "Saskatchewan Day", :regions => [:ca_sk]},
|
@@ -51,11 +51,11 @@ module Holidays
|
|
51
51
|
{:wday => 1, :week => 1, :name => "Natal Day", :regions => [:ca_ns]},
|
52
52
|
{:wday => 1, :week => 1, :name => "Civic Holiday", :regions => [:ca_on, :ca_nt, :ca_nu, :ca_pe]},
|
53
53
|
{:wday => 1, :week => 1, :name => "New Brunswick Day", :regions => [:ca_nb]},
|
54
|
-
{:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:
|
54
|
+
{:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:ca_yt]}],
|
55
55
|
9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]}],
|
56
56
|
10 => [{:wday => 1, :week => 2, :name => "Thanksgiving", :regions => [:ca]},
|
57
57
|
{:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
|
58
|
-
11 => [{:mday => 11, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Remembrance Day", :regions => [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :
|
58
|
+
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]}],
|
59
59
|
12 => [{:mday => 25, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Christmas Day", :regions => [:ca]},
|
60
60
|
{:mday => 26, :observed => "to_weekday_if_boxing_weekend(date)", :observed_arguments => [:date], :name => "Boxing Day", :regions => [:ca]}],
|
61
61
|
4 => [{:mday => 1, :type => :informal, :name => "April Fool's Day", :regions => [:us, :ca]},
|
@@ -13,7 +13,7 @@ module Holidays
|
|
13
13
|
# All the definitions are available at https://github.com/holidays/holidays
|
14
14
|
module NORTH_AMERICA # :nodoc:
|
15
15
|
def self.defined_regions
|
16
|
-
[:ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_mb, :ca_ns, :ca_pe, :
|
16
|
+
[:ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_mb, :ca_ns, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt, :mx, :mx_pue, :us, :us_dc, :us_ca]
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.holidays_by_month
|
@@ -41,7 +41,7 @@ module Holidays
|
|
41
41
|
{:wday => 1, :week => 3, :name => "Presidents' Day", :regions => [:us]},
|
42
42
|
{:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
|
43
43
|
{:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:us, :ca]}],
|
44
|
-
3 => [{:mday => 23, :name => "St. George's Day", :regions => [:
|
44
|
+
3 => [{:mday => 23, :name => "St. George's Day", :regions => [:ca_nl]},
|
45
45
|
{:wday => 1, :week => 3, :name => "Natalicio de Benito Juárez", :regions => [:mx]},
|
46
46
|
{:mday => 31, :name => "Cesar Chavez Day", :regions => [:us_ca]},
|
47
47
|
{:mday => 17, :type => :informal, :name => "St. Patrick's Day", :regions => [:us, :ca]}],
|
@@ -55,13 +55,13 @@ module Holidays
|
|
55
55
|
{:wday => 1, :week => -1, :name => "Memorial Day", :regions => [:us]},
|
56
56
|
{:wday => 0, :week => 2, :type => :informal, :name => "Mother's Day", :regions => [:us, :ca]},
|
57
57
|
{:wday => 6, :week => 3, :type => :informal, :name => "Armed Forces Day", :regions => [:us]}],
|
58
|
-
6 => [{:mday => 24, :name => "Discovery Day", :regions => [:
|
58
|
+
6 => [{:mday => 24, :name => "Discovery Day", :regions => [:ca_nl]},
|
59
59
|
{:mday => 24, :name => "Fête Nationale", :regions => [:ca_qc]},
|
60
60
|
{:mday => 21, :name => "National Aboriginal Day", :regions => [:ca_nt]},
|
61
61
|
{:wday => 0, :week => 3, :type => :informal, :name => "Día del Padre", :regions => [:mx]},
|
62
62
|
{:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
|
63
63
|
7 => [{:mday => 1, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Canada Day", :regions => [:ca]},
|
64
|
-
{:mday => 12, :name => "Orangemen's Day", :regions => [:
|
64
|
+
{:mday => 12, :name => "Orangemen's Day", :regions => [:ca_nl]},
|
65
65
|
{:mday => 9, :name => "Nunavut Day", :regions => [:ca_nu]},
|
66
66
|
{:mday => 4, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Independence Day", :regions => [:us]}],
|
67
67
|
8 => [{:wday => 1, :week => 1, :name => "BC Day", :regions => [:ca_bc]},
|
@@ -70,7 +70,7 @@ module Holidays
|
|
70
70
|
{:wday => 1, :week => 1, :name => "Natal Day", :regions => [:ca_ns]},
|
71
71
|
{:wday => 1, :week => 1, :name => "Civic Holiday", :regions => [:ca_on, :ca_nt, :ca_nu, :ca_pe]},
|
72
72
|
{:wday => 1, :week => 1, :name => "New Brunswick Day", :regions => [:ca_nb]},
|
73
|
-
{:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:
|
73
|
+
{:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:ca_yt]}],
|
74
74
|
9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]},
|
75
75
|
{:mday => 15, :name => "Grito de Dolores", :regions => [:mx]},
|
76
76
|
{:mday => 16, :name => "Día de la Independencia", :regions => [:mx]},
|
@@ -79,7 +79,7 @@ module Holidays
|
|
79
79
|
{:mday => 12, :type => :informal, :name => "Día de la Raza", :regions => [:mx]},
|
80
80
|
{:wday => 1, :week => 2, :name => "Columbus Day", :regions => [:us]},
|
81
81
|
{:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
|
82
|
-
11 => [{:mday => 11, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Remembrance Day", :regions => [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :
|
82
|
+
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]},
|
83
83
|
{:mday => 1, :type => :informal, :name => "Todos los Santos", :regions => [:mx]},
|
84
84
|
{:mday => 2, :type => :informal, :name => "Los Fieles Difuntos", :regions => [:mx]},
|
85
85
|
{:wday => 1, :week => 3, :name => "Día de la Revolución", :regions => [:mx]},
|
data/lib/holidays/version.rb
CHANGED
data/test/defs/test_defs_ca.rb
CHANGED
@@ -151,11 +151,11 @@ end
|
|
151
151
|
:ca_sk,
|
152
152
|
:ca_bc,
|
153
153
|
:ca_pe,
|
154
|
-
:
|
154
|
+
:ca_nl,
|
155
155
|
:ca_nt,
|
156
156
|
:ca_nu,
|
157
157
|
:ca_nb,
|
158
|
-
:
|
158
|
+
:ca_yt
|
159
159
|
].each do |province|
|
160
160
|
# Remembrance Day observed
|
161
161
|
[Date.civil(2010, 11, 11), Date.civil(2012, 11, 12), Date.civil(2017, 11, 13)].each do |date|
|
@@ -151,11 +151,11 @@ end
|
|
151
151
|
:ca_sk,
|
152
152
|
:ca_bc,
|
153
153
|
:ca_pe,
|
154
|
-
:
|
154
|
+
:ca_nl,
|
155
155
|
:ca_nt,
|
156
156
|
:ca_nu,
|
157
157
|
:ca_nb,
|
158
|
-
:
|
158
|
+
:ca_yt
|
159
159
|
].each do |province|
|
160
160
|
# Remembrance Day observed
|
161
161
|
[Date.civil(2010, 11, 11), Date.civil(2012, 11, 12), Date.civil(2017, 11, 13)].each do |date|
|