Repository: vacanza/python-holidays

Issue:
Mississippi Holiday - Confederate Memorial Day - Calculation incorrect
Library version: holidays 0.47

The date for Confederate Memorial Day this year is 2024-04-29.
The python-holidays library calculated it to be today, 2024-04-22.

https://www.sos.ms.gov/communications-publications/state-holidays
https://law.justia.com/codes/mississippi/2020/title-3/chapter-3/section-3-3-7/
the last Monday of April (Confederate Memorial Day);

`import holidays`
`#days = holidays.USA(years=[2024], subdiv='MS')`
`days = holidays.country_holidays('USA', subdiv='MS', years=[2024])`
`print(days)`


Output:

{datetime.date(2024, 1, 1): "New Year's Day", datetime.date(2024, 5, 27): 'Memorial Day', datetime.date(2024, 6, 19): 'Juneteenth National Independence Day', datetime.date(2024, 7, 4): 'Independence Day', datetime.date(2024, 9, 2): 'Labor Day', datetime.date(2024, 11, 11): 'Veterans Day', datetime.date(2024, 11, 28): 'Thanksgiving', datetime.date(2024, 12, 25): 'Christmas Day', datetime.date(2024, 2, 19): "Washington's Birthday", datetime.date(2024, 1, 15): "Dr. Martin Luther King Jr. and Robert E. Lee's Birthdays", **datetime.date(2024, 4, 22): 'Confederate Memorial Day'**}



Discussion:

Resolving patch:
diff --git a/holidays/countries/united_states.py b/holidays/countries/united_states.py
--- a/holidays/countries/united_states.py
+++ b/holidays/countries/united_states.py
@@ -609,7 +609,7 @@ def _populate_subdiv_ms_public_holidays(self):
 
         # Confederate Memorial Day
         if self._year >= 1866:
-            self._add_holiday_4th_mon_of_apr("Confederate Memorial Day")
+            self._add_holiday_last_mon_of_apr("Confederate Memorial Day")
 
     def _populate_subdiv_mt_public_holidays(self):
         # Election Day


Test patch:
diff --git a/tests/countries/test_united_states.py b/tests/countries/test_united_states.py
--- a/tests/countries/test_united_states.py
+++ b/tests/countries/test_united_states.py
@@ -1119,11 +1119,33 @@ def test_confederate_memorial_day(self):
             "2022-04-25",
             "2023-04-24",
         )
-        for subdiv in ("AL", "MS", "SC"):
+        for subdiv in ("AL", "SC"):
             self.assertHolidayName(name, self.state_hols[subdiv], range(1866, 2050))
             self.assertNoHolidayName(name, self.state_hols[subdiv], range(1865, 1866))
             self.assertHolidayName(name, self.state_hols[subdiv], dt)
 
+        self.assertHolidayName(
+            name,
+            self.state_hols["MS"],
+            "2010-04-26",
+            "2011-04-25",
+            "2012-04-30",
+            "2013-04-29",
+            "2014-04-28",
+            "2015-04-27",
+            "2016-04-25",
+            "2017-04-24",
+            "2018-04-30",
+            "2019-04-29",
+            "2020-04-27",
+            "2021-04-26",
+            "2022-04-25",
+            "2023-04-24",
+            "2024-04-29",
+        )
+        self.assertHolidayName(name, self.state_hols["MS"], range(1866, 2050))
+        self.assertNoHolidayName(name, self.state_hols["MS"], range(1865, 1866))
+
         self.assertHolidayName(
             name, self.state_hols["TX"], (f"{year}-01-19" for year in range(1931, 2050))
         )