Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion definitions
Submodule definitions updated 1 files
+73 −1 ca.yaml
4 changes: 3 additions & 1 deletion lib/generated_definitions/ca.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def self.holidays_by_month
{:wday => 1, :week => 1, :type => :informal, :name => "Civic Holiday", :regions => [:ca_on, :ca_pe]},
{:wday => 1, :week => 1, :name => "New Brunswick Day", :regions => [:ca_nb]},
{:wday => 1, :week => 3, :name => "Discovery Day", :regions => [:ca_yt]}],
9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]}],
9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]},
{:mday => 30, :year_ranges => [{:after => 2026}],:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "National Day for Truth and Reconciliation", :regions => [:ca_bc, :ca_pe]},
{:mday => 30, :year_ranges => [{:after => 2026}],:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :type => :informal, :name => "National Day for Truth and Reconciliation", :regions => [:ca_ab, :ca_mb]}],
10 => [{:wday => 1, :week => 2, :name => "Thanksgiving", :regions => [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt]},
{:mday => 31, :type => :informal, :name => "Halloween", :regions => [:us, :ca]}],
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]}],
Expand Down
2 changes: 2 additions & 0 deletions lib/generated_definitions/north_america.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def self.holidays_by_month
{:wday => 5, :week => 3, :name => "Statehood Day", :regions => [:us_hi]},
{:mday => 27, :name => "Lyndon Baines Johnson Day", :regions => [:us_tx]}],
9 => [{:wday => 1, :week => 1, :name => "Labour Day", :regions => [:ca]},
{:mday => 30, :year_ranges => [{:after => 2026}],:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "National Day for Truth and Reconciliation", :regions => [:ca_bc, :ca_pe]},
{:mday => 30, :year_ranges => [{:after => 2026}],:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :type => :informal, :name => "National Day for Truth and Reconciliation", :regions => [:ca_ab, :ca_mb]},
{:mday => 15, :name => "Grito de Dolores", :regions => [:mx]},
{:mday => 16, :name => "Día de la Independencia", :regions => [:mx]},
{:wday => 1, :week => 1, :name => "Labor Day", :regions => [:us]},
Expand Down
48 changes: 48 additions & 0 deletions test/defs/test_defs_ca.rb
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,54 @@ def test_ca
assert_includes matching_holiday[:regions], :ca_yt


holidays = Holidays.on(Date.civil(2026, 9, 30), [:ca_bc, :ca_pe])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2026, 9, 30), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_bc
assert_includes matching_holiday[:regions], :ca_pe


holidays = Holidays.on(Date.civil(2027, 9, 30), [:ca_bc, :ca_pe])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2027, 9, 30), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_bc
assert_includes matching_holiday[:regions], :ca_pe


holidays = Holidays.on(Date.civil(2026, 9, 30), [:ca_ab, :ca_mb], [:informal])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2026, 9, 30), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_ab
assert_includes matching_holiday[:regions], :ca_mb


assert_nil (Holidays.on(Date.civil(2026, 9, 30), [:ca_ab, :ca_mb])[0] || {})[:name]

assert_nil (Holidays.on(Date.civil(2025, 9, 30), [:ca_bc, :ca_pe])[0] || {})[:name]

assert_nil (Holidays.on(Date.civil(2023, 10, 2), [:ca_bc, :ca_pe], [:observed])[0] || {})[:name]

assert_nil (Holidays.on(Date.civil(2026, 9, 30), [:ca_on, :ca_qc, :ca_ns, :ca_nb, :ca_nl, :ca_sk], [:informal])[0] || {})[:name]

holidays = Holidays.on(Date.civil(2028, 10, 2), [:ca_bc, :ca_pe], [:observed])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2028, 10, 2), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_bc
assert_includes matching_holiday[:regions], :ca_pe


holidays = Holidays.on(Date.civil(2029, 10, 1), [:ca_bc, :ca_pe], [:observed])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2029, 10, 1), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_bc
assert_includes matching_holiday[:regions], :ca_pe


holidays = Holidays.on(Date.civil(2013, 2, 2), [:us], [:informal])
matching_holiday = holidays.find { |hol| hol[:name] == "Groundhog Day" }
assert_not_nil matching_holiday
Expand Down
48 changes: 48 additions & 0 deletions test/defs/test_defs_north_america.rb
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,54 @@ def test_north_america
assert_includes matching_holiday[:regions], :ca_yt


holidays = Holidays.on(Date.civil(2026, 9, 30), [:ca_bc, :ca_pe])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2026, 9, 30), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_bc
assert_includes matching_holiday[:regions], :ca_pe


holidays = Holidays.on(Date.civil(2027, 9, 30), [:ca_bc, :ca_pe])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2027, 9, 30), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_bc
assert_includes matching_holiday[:regions], :ca_pe


holidays = Holidays.on(Date.civil(2026, 9, 30), [:ca_ab, :ca_mb], [:informal])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2026, 9, 30), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_ab
assert_includes matching_holiday[:regions], :ca_mb


assert_nil (Holidays.on(Date.civil(2026, 9, 30), [:ca_ab, :ca_mb])[0] || {})[:name]

assert_nil (Holidays.on(Date.civil(2025, 9, 30), [:ca_bc, :ca_pe])[0] || {})[:name]

assert_nil (Holidays.on(Date.civil(2023, 10, 2), [:ca_bc, :ca_pe], [:observed])[0] || {})[:name]

assert_nil (Holidays.on(Date.civil(2026, 9, 30), [:ca_on, :ca_qc, :ca_ns, :ca_nb, :ca_nl, :ca_sk], [:informal])[0] || {})[:name]

holidays = Holidays.on(Date.civil(2028, 10, 2), [:ca_bc, :ca_pe], [:observed])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2028, 10, 2), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_bc
assert_includes matching_holiday[:regions], :ca_pe


holidays = Holidays.on(Date.civil(2029, 10, 1), [:ca_bc, :ca_pe], [:observed])
matching_holiday = holidays.find { |hol| hol[:name] == "National Day for Truth and Reconciliation" }
assert_not_nil matching_holiday
assert_equal Date.civil(2029, 10, 1), matching_holiday[:date]
assert_includes matching_holiday[:regions], :ca_bc
assert_includes matching_holiday[:regions], :ca_pe


holidays = Holidays.on(Date.civil(2007, 1, 1), [:mx], [:informal])
matching_holiday = holidays.find { |hol| hol[:name] == "Año nuevo" }
assert_not_nil matching_holiday
Expand Down