Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Greece holidays #1663

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
20 changes: 14 additions & 6 deletions holidays/countries/greece.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
from holidays.calendars.julian_revised import JULIAN_REVISED_CALENDAR
from holidays.constants import HALF_DAY, PUBLIC
from holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NEXT_WORKDAY
from holidays.observed_holiday_base import (
ObservedHolidayBase,
SAT_SUN_TO_NEXT_WORKDAY,
MON_TO_NEXT_TUE,
KJhellico marked this conversation as resolved.
Show resolved Hide resolved
)


class Greece(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
Expand All @@ -36,6 +40,7 @@ def __init__(self, *args, **kwargs):
ChristianHolidays.__init__(self, JULIAN_REVISED_CALENDAR)
InternationalHolidays.__init__(self)
kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_WORKDAY)
kwargs.setdefault("observed_since", 2017)
super().__init__(*args, **kwargs)

def _populate_public_holidays(self):
Expand All @@ -45,7 +50,7 @@ def _populate_public_holidays(self):
# Epiphany.
self._add_epiphany_day(tr("Θεοφάνεια"))

# Clean Monday.
# Green Monday.
self._add_ash_monday(tr("Καθαρά Δευτέρα"))

# Independence Day.
Expand All @@ -55,13 +60,16 @@ def _populate_public_holidays(self):
self._add_good_friday(tr("Μεγάλη Παρασκευή"))

# Easter Monday.
self._add_easter_monday(tr("Δευτέρα του Πάσχα"))
easter_monday = self._add_easter_monday(tr("Δευτέρα του Πάσχα"))

# Monday of the Holy Spirit.
# Whit Monday.
self._add_whit_monday(tr("Δευτέρα του Αγίου Πνεύματος"))

# Labour Day.
self._add_observed(self._add_labor_day(self.tr("Εργατική Πρωτομαγιά")))
self._add_observed(
# Labor Day.
may_1 := self._add_labor_day(self.tr("Εργατική Πρωτομαγιά")),
rule=MON_TO_NEXT_TUE if may_1 == easter_monday else SAT_SUN_TO_NEXT_WORKDAY,
)

# Dormition of the Mother of God.
self._add_assumption_of_mary_day(tr("Κοίμηση της Θεοτόκου"))
Expand Down
6 changes: 3 additions & 3 deletions holidays/locale/el/LC_MESSAGES/GR.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ msgstr ""
msgid "Θεοφάνεια"
msgstr ""

#. Clean Monday.
#. Green Monday.
msgid "Καθαρά Δευτέρα"
msgstr ""

Expand All @@ -40,11 +40,11 @@ msgstr ""
msgid "Δευτέρα του Πάσχα"
msgstr ""

#. Monday of the Holy Spirit.
#. Whit Monday.
msgid "Δευτέρα του Αγίου Πνεύματος"
msgstr ""

#. Labour Day.
#. Labor Day.
msgid "Εργατική Πρωτομαγιά"
msgstr ""

Expand Down
10 changes: 5 additions & 5 deletions holidays/locale/en_US/LC_MESSAGES/GR.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ msgstr "New Year's Day"
msgid "Θεοφάνεια"
msgstr "Epiphany"

#. Clean Monday.
#. Green Monday.
msgid "Καθαρά Δευτέρα"
msgstr "Clean Monday"
msgstr "Green Monday"

#. Independence Day.
msgid "Εικοστή Πέμπτη Μαρτίου"
Expand All @@ -40,11 +40,11 @@ msgstr "Good Friday"
msgid "Δευτέρα του Πάσχα"
msgstr "Easter Monday"

#. Monday of the Holy Spirit.
#. Whit Monday.
msgid "Δευτέρα του Αγίου Πνεύματος"
msgstr "Easter Monday"
msgstr "Whit Monday"

#. Labour Day.
#. Labor Day.
msgid "Εργατική Πρωτομαγιά"
msgstr "Labor Day"

Expand Down
6 changes: 3 additions & 3 deletions holidays/locale/uk/LC_MESSAGES/GR.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ msgstr "Новий рік"
msgid "Θεοφάνεια"
msgstr "Богоявлення"

#. Clean Monday.
#. Green Monday.
msgid "Καθαρά Δευτέρα"
msgstr "Чистий понеділок"

Expand All @@ -40,11 +40,11 @@ msgstr "Страсна пʼятниця"
msgid "Δευτέρα του Πάσχα"
msgstr "Великодній понеділок"

#. Monday of the Holy Spirit.
#. Whit Monday.
msgid "Δευτέρα του Αγίου Πνεύματος"
msgstr "День Святого Духа"

#. Labour Day.
#. Labor Day.
msgid "Εργατική Πρωτομαγιά"
msgstr "День праці"

Expand Down
19 changes: 0 additions & 19 deletions snapshots/countries/GR_COMMON.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"1954-04-23": "Good Friday",
"1954-04-26": "Easter Monday",
"1954-05-01": "Labor Day",
"1954-05-03": "Labor Day (observed)",
"1954-06-14": "Easter Monday",
"1954-08-15": "Dormition of the Mother of God",
"1954-10-28": "Ochi Day",
Expand All @@ -77,7 +76,6 @@
"1955-04-15": "Good Friday",
"1955-04-18": "Easter Monday",
"1955-05-01": "Labor Day",
"1955-05-02": "Labor Day (observed)",
"1955-06-06": "Easter Monday",
"1955-08-15": "Dormition of the Mother of God",
"1955-10-28": "Ochi Day",
Expand Down Expand Up @@ -147,7 +145,6 @@
"1960-04-15": "Good Friday",
"1960-04-18": "Easter Monday",
"1960-05-01": "Labor Day",
"1960-05-02": "Labor Day (observed)",
"1960-06-06": "Easter Monday",
"1960-08-15": "Dormition of the Mother of God",
"1960-10-28": "Ochi Day",
Expand Down Expand Up @@ -217,7 +214,6 @@
"1965-04-23": "Good Friday",
"1965-04-26": "Easter Monday",
"1965-05-01": "Labor Day",
"1965-05-03": "Labor Day (observed)",
"1965-06-14": "Easter Monday",
"1965-08-15": "Dormition of the Mother of God",
"1965-10-28": "Ochi Day",
Expand All @@ -232,7 +228,6 @@
"1966-04-08": "Good Friday",
"1966-04-11": "Easter Monday",
"1966-05-01": "Labor Day",
"1966-05-02": "Labor Day (observed)",
"1966-05-30": "Easter Monday",
"1966-08-15": "Dormition of the Mother of God",
"1966-10-28": "Ochi Day",
Expand Down Expand Up @@ -302,7 +297,6 @@
"1971-04-16": "Good Friday",
"1971-04-19": "Easter Monday",
"1971-05-01": "Labor Day",
"1971-05-03": "Labor Day (observed)",
"1971-06-07": "Easter Monday",
"1971-08-15": "Dormition of the Mother of God",
"1971-10-28": "Ochi Day",
Expand Down Expand Up @@ -373,7 +367,6 @@
"1976-04-23": "Good Friday",
"1976-04-26": "Easter Monday",
"1976-05-01": "Labor Day",
"1976-05-03": "Labor Day (observed)",
"1976-06-14": "Easter Monday",
"1976-08-15": "Dormition of the Mother of God",
"1976-10-28": "Ochi Day",
Expand All @@ -388,7 +381,6 @@
"1977-04-08": "Good Friday",
"1977-04-11": "Easter Monday",
"1977-05-01": "Labor Day",
"1977-05-02": "Labor Day (observed)",
"1977-05-30": "Easter Monday",
"1977-08-15": "Dormition of the Mother of God",
"1977-10-28": "Ochi Day",
Expand Down Expand Up @@ -458,7 +450,6 @@
"1982-04-16": "Good Friday",
"1982-04-19": "Easter Monday",
"1982-05-01": "Labor Day",
"1982-05-03": "Labor Day (observed)",
"1982-06-07": "Easter Monday",
"1982-08-15": "Dormition of the Mother of God",
"1982-10-28": "Ochi Day",
Expand All @@ -471,7 +462,6 @@
"1983-03-21": "Clean Monday",
"1983-03-25": "Independence Day",
"1983-05-01": "Labor Day",
"1983-05-02": "Labor Day (observed)",
"1983-05-06": "Good Friday",
"1983-05-09": "Easter Monday",
"1983-06-27": "Easter Monday",
Expand Down Expand Up @@ -544,7 +534,6 @@
"1988-04-08": "Good Friday",
"1988-04-11": "Easter Monday",
"1988-05-01": "Labor Day",
"1988-05-02": "Labor Day (observed)",
"1988-05-30": "Easter Monday",
"1988-08-15": "Dormition of the Mother of God",
"1988-10-28": "Ochi Day",
Expand Down Expand Up @@ -614,7 +603,6 @@
"1993-04-16": "Good Friday",
"1993-04-19": "Easter Monday",
"1993-05-01": "Labor Day",
"1993-05-03": "Labor Day (observed)",
"1993-06-07": "Easter Monday",
"1993-08-15": "Dormition of the Mother of God",
"1993-10-28": "Ochi Day",
Expand All @@ -629,7 +617,6 @@
"1994-04-29": "Good Friday",
"1994-05-01": "Labor Day",
"1994-05-02": "Easter Monday",
"1994-05-03": "Labor Day (observed)",
"1994-06-20": "Easter Monday",
"1994-08-15": "Dormition of the Mother of God",
"1994-10-28": "Ochi Day",
Expand Down Expand Up @@ -700,7 +687,6 @@
"1999-04-09": "Good Friday",
"1999-04-12": "Easter Monday",
"1999-05-01": "Labor Day",
"1999-05-03": "Labor Day (observed)",
"1999-05-31": "Easter Monday",
"1999-08-15": "Dormition of the Mother of God",
"1999-10-28": "Ochi Day",
Expand Down Expand Up @@ -770,7 +756,6 @@
"2004-04-09": "Good Friday",
"2004-04-12": "Easter Monday",
"2004-05-01": "Labor Day",
"2004-05-03": "Labor Day (observed)",
"2004-05-31": "Easter Monday",
"2004-08-15": "Dormition of the Mother of God",
"2004-10-28": "Ochi Day",
Expand All @@ -785,7 +770,6 @@
"2005-04-29": "Good Friday",
"2005-05-01": "Labor Day",
"2005-05-02": "Easter Monday",
"2005-05-03": "Labor Day (observed)",
"2005-06-20": "Easter Monday",
"2005-08-15": "Dormition of the Mother of God",
"2005-10-28": "Ochi Day",
Expand Down Expand Up @@ -856,7 +840,6 @@
"2010-04-02": "Good Friday",
"2010-04-05": "Easter Monday",
"2010-05-01": "Labor Day",
"2010-05-03": "Labor Day (observed)",
"2010-05-24": "Easter Monday",
"2010-08-15": "Dormition of the Mother of God",
"2010-10-28": "Ochi Day",
Expand All @@ -871,7 +854,6 @@
"2011-04-22": "Good Friday",
"2011-04-25": "Easter Monday",
"2011-05-01": "Labor Day",
"2011-05-02": "Labor Day (observed)",
"2011-06-13": "Easter Monday",
"2011-08-15": "Dormition of the Mother of God",
"2011-10-28": "Ochi Day",
Expand Down Expand Up @@ -942,7 +924,6 @@
"2016-04-29": "Good Friday",
"2016-05-01": "Labor Day",
"2016-05-02": "Easter Monday",
"2016-05-03": "Labor Day (observed)",
"2016-06-20": "Easter Monday",
"2016-08-15": "Dormition of the Mother of God",
"2016-10-28": "Ochi Day",
Expand Down
14 changes: 6 additions & 8 deletions tests/countries/test_greece.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_easter_monday(self):
"2024-05-06",
)

def test_monday_of_the_holy_spirit(self):
def test_whit_monday(self):
self.assertHolidayName(
"Δευτέρα του Αγίου Πνεύματος",
"2018-05-28",
Expand All @@ -86,19 +86,17 @@ def test_monday_of_the_holy_spirit(self):
"2024-06-24",
)

def test_labour_day_observed(self):
def test_labor_day_observed(self):
name_observed = "Εργατική Πρωτομαγιά (παρατηρήθηκε)"
dt = (
"2011-05-02",
"2016-05-03",
"2021-05-04",
"2022-05-02",
)
self.assertHolidayName(name_observed, dt)
self.assertNoNonObservedHoliday(dt)
self.assertNoHolidayName(name_observed, 2017, 2018, 2019, 2020, 2023)
self.assertNoHolidayName(name_observed, range(2000, 2021), 2023)

def test_hal_day_2022(self):
def test_half_day_2022(self):
self.assertHolidays(
Greece(categories=HALF_DAY, years=2022),
("2022-12-24", "Παραμονή Χριστουγέννων"),
Expand Down Expand Up @@ -133,13 +131,13 @@ def test_l10n_en_us(self):
"en_US",
("2022-01-01", "New Year's Day"),
("2022-01-06", "Epiphany"),
("2022-03-07", "Clean Monday"),
("2022-03-07", "Green Monday"),
("2022-03-25", "Independence Day"),
("2022-04-22", "Good Friday"),
("2022-04-25", "Easter Monday"),
("2022-05-01", "Labor Day"),
("2022-05-02", "Labor Day (observed)"),
("2022-06-13", "Easter Monday"),
("2022-06-13", "Whit Monday"),
("2022-08-15", "Dormition of the Mother of God"),
("2022-10-28", "Ochi Day"),
("2022-12-24", "Christmas Eve"),
Expand Down