Skip to content

Commit

Permalink
[by] Easter holidays is now always on the public holidays list
Browse files Browse the repository at this point in the history
  • Loading branch information
PPsyrius committed Dec 27, 2024
1 parent f68a5ec commit ff92abe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
26 changes: 11 additions & 15 deletions holidays/countries/belarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,21 @@ def _populate_public_holidays(self):
# Catholic Christmas Day.
self._add_christmas_day(tr("Нараджэнне Хрыстова (каталіцкае Раство)"), GREGORIAN_CALENDAR)

if 1992 <= self._year <= 1997:
if self._year >= 1992:
# Catholic Easter.
name = tr("Каталiцкi Вялiкдзень")
self._add_easter_sunday(name, GREGORIAN_CALENDAR)
self._add_easter_monday(name, GREGORIAN_CALENDAR)
name_catholic = tr("Каталiцкi Вялiкдзень")
self._add_easter_sunday(name_catholic, GREGORIAN_CALENDAR)

# Orthodox Easter.
name = tr("Праваслаўны Вялiкдзень")
self._add_easter_sunday(name)
self._add_easter_monday(name)
name_orthodox = tr("Праваслаўны Вялiкдзень")
self._add_easter_sunday(name_orthodox)

# Dzyady (All Souls' Day).
self._add_all_souls_day(tr("Дзень памяці"))
if self._year <= 1997:
self._add_easter_monday(name_catholic, GREGORIAN_CALENDAR)
self._add_easter_monday(name_orthodox)

# Dzyady (All Souls' Day).
self._add_all_souls_day(tr("Дзень памяці"))

def _populate_workday_holidays(self):
# Day of the Fatherland's Defenders and the Armed Forces of the Republic of Belarus.
Expand Down Expand Up @@ -131,12 +133,6 @@ def _populate_workday_holidays(self):
self._add_holiday_sep_17(tr("Дзень народнага адзінства"))

if self._year >= 1998:
# Catholic Easter.
self._add_easter_sunday(tr("Каталiцкi Вялiкдзень"), GREGORIAN_CALENDAR)

# Orthodox Easter.
self._add_easter_sunday(tr("Праваслаўны Вялiкдзень"))

# Dzyady (All Souls' Day).
self._add_all_souls_day(tr("Дзень памяці"))

Expand Down
12 changes: 6 additions & 6 deletions tests/countries/test_belarus.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def test_public_2018(self):
("2018-01-07", "Нараджэнне Хрыстова (праваслаўнае Раство)"),
("2018-03-08", "Дзень жанчын"),
("2018-03-09", "Выходны (перанесены з 03.03.2018)"),
("2018-04-01", "Каталiцкi Вялiкдзень"),
("2018-04-08", "Праваслаўны Вялiкдзень"),
("2018-04-16", "Выходны (перанесены з 14.04.2018)"),
("2018-04-17", "Радаўніца"),
("2018-04-30", "Выходны (перанесены з 28.04.2018)"),
Expand Down Expand Up @@ -167,9 +169,8 @@ def test_catholic_easter(self):
"2029-04-01",
"2030-04-21",
)
self.assertHolidayName(name, self.workdays, dt)
self.assertNoHolidayName(name, self.workdays, range(1991, 1998))
self.assertNoHolidayName(name, 1991, range(1998, 2050))
self.assertHolidayName(name, dt)
self.assertNoHolidayName(name, 1991)

def test_orthodox_easter(self):
name = "Праваслаўны Вялiкдзень"
Expand All @@ -196,9 +197,8 @@ def test_orthodox_easter(self):
"2029-04-08",
"2030-04-28",
)
self.assertHolidayName(name, self.workdays, dt)
self.assertNoHolidayName(name, self.workdays, range(1991, 1998))
self.assertNoHolidayName(name, 1991, range(1998, 2050))
self.assertHolidayName(name, dt)
self.assertNoHolidayName(name, 1991)

def test_radunitsa(self):
# https://calendar.by/content.php?id=20
Expand Down

0 comments on commit ff92abe

Please sign in to comment.