Skip to content

Commit

Permalink
Fix issues with holidays that fall on Monday after the second Sunday
Browse files Browse the repository at this point in the history
  • Loading branch information
kasya committed Aug 14, 2024
1 parent 1e141a9 commit 23dad20
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 26 deletions.
17 changes: 3 additions & 14 deletions holidays/countries/samoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@
# Website: https://github.com/vacanza/python-holidays
# License: MIT (see LICENSE file)

# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)

from holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.holiday_base import HolidayBase

Expand Down Expand Up @@ -56,16 +45,16 @@ def _populate(self, year):
self._add_easter_monday("Easter Monday")

# Mother's Day.
self._add_holiday_2nd_mon_of_may("Mother's Day")
self._add_holiday_1_day_past_2nd_sun_of_may("Mother's Day")

# Independence Day.
self._add_holiday_jun_1("Independence Day")

# Father's Day.
self._add_holiday_2nd_mon_of_aug("Father's Day")
self._add_holiday_1_day_past_2nd_sun_of_aug("Father's Day")

# White Monday (Lotu a Tamaiti).
self._add_holiday_2nd_mon_of_oct("White Monday (Lotu a Tamaiti)")
self._add_holiday_1_day_past_2nd_sun_of_oct("White Monday (Lotu a Tamaiti)")

# Christmas Day.
self._add_christmas_day("Christmas Day")
Expand Down
13 changes: 1 addition & 12 deletions tests/countries/test_samoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@
# Website: https://github.com/vacanza/python-holidays
# License: MIT (see LICENSE file)

# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)

from unittest import TestCase

from holidays.countries.samoa import Samoa, WS, WSM
Expand Down Expand Up @@ -60,7 +49,7 @@ def test_2023(self):
("2023-04-07", "Good Friday"),
("2023-04-08", "Day After Good Friday"),
("2023-04-10", "Easter Monday"),
("2023-05-08", "Mother's Day"),
("2023-05-15", "Mother's Day"),
("2023-06-01", "Independence Day"),
("2023-08-14", "Father's Day"),
("2023-10-09", "White Monday (Lotu a Tamaiti)"),
Expand Down

0 comments on commit 23dad20

Please sign in to comment.