FIX: Independence Day should use to_weekday_if_weekend(date) for all US (#141)

FIX: Independence Day should use to_weekday_if_weekend(date) for all US (#141)

  • FIX: Independence Day should use to_weekday_if_weekend(date) for all US

When Independence Day does not fall on a weekend, it is observed on a weekday. This was only happening for the state of Virginia. It has been updated to conform with the way things are handled for holidays like New Years Day and Christmas.

See https://publicholidays.us/independence-day/ which is also referenced on line 66.

diff --git a/vendor/holidays/definitions/us.yaml b/vendor/holidays/definitions/us.yaml
index f9799b7..66eca9d 100644
--- a/vendor/holidays/definitions/us.yaml
+++ b/vendor/holidays/definitions/us.yaml
@@ -207,10 +207,7 @@ months:
   - name: Independence Day # fixed
     regions: [us]
     mday: 4
-  - name: Independence Day (Holiday)
-    regions: [us_va]
-    mday: 4
-    function: to_weekday_if_weekend(date) # Note: Always if Independence Day don't match
+    function: to_weekday_if_weekend(date)
   - name: Pioneer Day # fixed
     regions: [us_ut]
     mday: 24
diff --git a/vendor/holidays/lib/generated_definitions/northamerica.rb b/vendor/holidays/lib/generated_definitions/northamerica.rb
index 3992d3f..6f2fd51 100644
--- a/vendor/holidays/lib/generated_definitions/northamerica.rb
+++ b/vendor/holidays/lib/generated_definitions/northamerica.rb
@@ -81,8 +81,7 @@ module Holidays
             {:mday => 12, :type => :informal, :name => "Orangemen's Day", :regions => [:ca_nl]},
             {:mday => 9, :year_ranges => { :from => 2020 },:observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Nunavut Day", :regions => [:ca_nu]},
             {:mday => 3, :name => "Emancipation Day", :regions => [:us_vi]},
-            {:mday => 4, :name => "Independence Day", :regions => [:us]},
-            {:mday => 4, :function => "to_weekday_if_weekend(date)", :function_arguments => [:date], :name => "Independence Day (Holiday)", :regions => [:us_va]},
+            {:mday => 4, :function => "to_weekday_if_weekend(date)", :function_arguments => [:date], :name => "Independence Day", :regions => [:us]},
             {:mday => 24, :name => "Pioneer Day", :regions => [:us_ut]}],
       8 => [{:wday => 1, :week => 1, :name => "B.C. Day", :regions => [:ca_bc]},
             {:wday => 1, :week => 1, :name => "Saskatchewan Day", :regions => [:ca_sk]},
diff --git a/vendor/holidays/lib/generated_definitions/us.rb b/vendor/holidays/lib/generated_definitions/us.rb
index 19af01d..79175da 100644
--- a/vendor/holidays/lib/generated_definitions/us.rb
+++ b/vendor/holidays/lib/generated_definitions/us.rb
@@ -55,8 +55,7 @@ module Holidays
             {:mday => 20, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "West Virginia Day", :regions => [:us_wv]},
             {:wday => 0, :week => 3, :type => :informal, :name => "Father's Day", :regions => [:us, :ca]}],
       7 => [{:mday => 3, :name => "Emancipation Day", :regions => [:us_vi]},
-            {:mday => 4, :name => "Independence Day", :regions => [:us]},
-            {:mday => 4, :function => "to_weekday_if_weekend(date)", :function_arguments => [:date], :name => "Independence Day (Holiday)", :regions => [:us_va]},
+            {:mday => 4, :function => "to_weekday_if_weekend(date)", :function_arguments => [:date], :name => "Independence Day", :regions => [:us]},
             {:mday => 24, :name => "Pioneer Day", :regions => [:us_ut]}],
       8 => [{:wday => 1, :week => 2, :name => "Victory Day", :regions => [:us_ri]},
             {:mday => 16, :observed => "to_weekday_if_weekend(date)", :observed_arguments => [:date], :name => "Bennington Battle Day", :regions => [:us_vt]},

GitHub sha: 4d76d2787fd4dd6fb929ade262f6978b05470a59

1 Like

This commit appears in #141 which was approved by SamSaffron. It was merged by SamSaffron.