Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
27 changes: 18 additions & 9 deletions holidays/countries/ukraine.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class Ukraine(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
"""
Ukraine holidays.

Current holidays list:
- https://zakon1.rada.gov.ua/laws/show/322-08/paran454#n454
References:
- Labor Code of Ukraine, Art. 73 `<https://zakon1.rada.gov.ua/laws/show/322-08/paran454#n454>`_
- https://zakon.rada.gov.ua/laws/show/585-12
"""

country = "UA"
Expand Down Expand Up @@ -71,10 +72,9 @@ def _populate_common(self, is_martial_law: bool = False):
# International Women's Day.
dts_observed.add(self._add_womens_day(tr("Міжнародний жіночий день")))

if (self._year >= 2022) == is_martial_law:
if self._year >= 1992:
# Easter Sunday (Pascha).
dts_observed.add(self._add_easter_sunday(tr("Великдень (Пасха)")))
if (self._year >= 2022) is is_martial_law:
# Easter Sunday (Pascha).
dts_observed.add(self._add_easter_sunday(tr("Великдень (Пасха)")))

# Holy Trinity Day.
dts_observed.add(self._add_whit_sunday(tr("Трійця")))
Expand Down Expand Up @@ -169,6 +169,7 @@ class UKR(Ukraine):
class UkraineStaticHolidays:
"""
Substituted holidays:
- `1991 <https://zakon.rada.gov.ua/laws/show/60-91-%D0%BF>`_
- `1992 [1] <https://zakon.rada.gov.ua/laws/show/202-92-%D0%BF>`_
- `1992 [2] <https://zakon.rada.gov.ua/laws/show/377-91-%D0%BF>`_
- `1993 [1] <https://zakon.rada.gov.ua/laws/show/563-93-%D0%BF>`_
Expand All @@ -178,8 +179,9 @@ class UkraineStaticHolidays:
- `1995 [2] <https://zakon.rada.gov.ua/laws/show/634-95-%D0%BF>`_
- `1995 [3] <https://zakon.rada.gov.ua/laws/show/266-95-%D0%BF>`_
- `1996 <https://zakon.rada.gov.ua/laws/show/424-96-%D0%BF>`_
- `1997[1] <https://zakon.rada.gov.ua/laws/show/326-97-%D0%BF>`_
- `1997[2] <https://zakon.rada.gov.ua/laws/show/1547-96-%D0%BF>`_
- `1997 [1] <https://zakon.rada.gov.ua/laws/show/326-97-%D0%BF>`_
- `1997 [2] <https://zakon.rada.gov.ua/laws/show/1547-96-%D0%BF>`_
- `1998 <https://zakon.rada.gov.ua/laws/show/1404-97-%D0%BF>`_,
- `1999 [1] <https://zakon.rada.gov.ua/laws/show/1433-99-%D0%BF>`_,
- `1999 [2] <https://zakon.rada.gov.ua/laws/show/558-99-%D0%BF>`_,
- `1999 [3] <https://zakon.rada.gov.ua/laws/show/2070-98-%D0%BF>`_
Expand Down Expand Up @@ -221,6 +223,11 @@ class UkraineStaticHolidays:
# Day off (substituted from %s).
substituted_label = tr("Вихідний день (перенесено з %s)")
special_public_holidays = {
1991: (
(MAY, 3, MAY, 5),
(MAY, 10, MAY, 12),
(JUL, 15, JUL, 13),
),
1992: (
(JAN, 6, JAN, 4),
(APR, 27, MAY, 16),
Expand All @@ -244,9 +251,11 @@ class UkraineStaticHolidays:
1997: (
(JAN, 2, DEC, 28, 1996),
(JAN, 6, JAN, 4),
(JAN, 8, JAN, 11),
(APR, 29, APR, 19),
(APR, 30, MAY, 17),
),
1998: (JAN, 2, JAN, 4),
1999: (
(JAN, 8, JAN, 10),
(APR, 12, APR, 24),
Expand Down Expand Up @@ -324,7 +333,7 @@ class UkraineStaticHolidays:
),
2012: (
(MAR, 9, MAR, 3),
(APR, 20, APR, 28),
(APR, 30, APR, 28),
(JUN, 29, JUL, 7),
(DEC, 31, DEC, 29),
),
Expand Down
8 changes: 7 additions & 1 deletion snapshots/countries/UA_COMMON.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
"1991-01-01": "New Year's Day",
"1991-01-07": "Christmas Day",
"1991-03-08": "International Women's Day",
"1991-04-07": "Easter Sunday (Pascha)",
"1991-05-01": "International Workers' Solidarity Day",
"1991-05-02": "International Workers' Solidarity Day",
"1991-05-03": "Day off (substituted from 05/05/1991)",
"1991-05-09": "Victory Day",
"1991-05-10": "Day off (substituted from 05/12/1991)",
"1991-05-26": "Holy Trinity Day",
"1991-07-15": "Day off (substituted from 07/13/1991)",
"1991-07-16": "Independence Day",
"1991-11-07": "Anniversary of the Great October Socialist Revolution",
"1991-11-08": "Anniversary of the Great October Socialist Revolution",
Expand Down Expand Up @@ -84,6 +88,7 @@
"1997-01-02": "Day off (substituted from 12/28/1996)",
"1997-01-06": "Day off (substituted from 01/04/1997)",
"1997-01-07": "Christmas Day",
"1997-01-08": "Day off (substituted from 01/11/1997)",
"1997-03-08": "International Women's Day",
"1997-03-10": "International Women's Day (observed)",
"1997-04-27": "Easter Sunday (Pascha)",
Expand All @@ -103,6 +108,7 @@
"1997-11-08": "Anniversary of the Great October Socialist Revolution",
"1997-11-10": "Anniversary of the Great October Socialist Revolution (observed)",
"1998-01-01": "New Year's Day",
"1998-01-02": "Day off (substituted from 01/04/1998)",
"1998-01-07": "Christmas Day",
"1998-03-08": "International Women's Day",
"1998-04-19": "Easter Sunday (Pascha)",
Expand Down Expand Up @@ -358,7 +364,7 @@
"2012-03-09": "Day off (substituted from 03/03/2012)",
"2012-04-15": "Easter Sunday (Pascha)",
"2012-04-16": "Easter Sunday (Pascha) (observed)",
"2012-04-20": "Day off (substituted from 04/28/2012)",
"2012-04-30": "Day off (substituted from 04/28/2012)",
"2012-05-01": "International Workers' Solidarity Day",
"2012-05-02": "International Workers' Solidarity Day",
"2012-05-09": "Victory Day",
Expand Down
14 changes: 10 additions & 4 deletions tests/countries/test_ukraine.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ def test_easter(self):
"2020-04-19",
"2021-05-02",
)
self.assertHolidayName(name, range(1992, 2022))
self.assertNoHolidayName(name, 1991)
self.assertHolidayName(name, range(1991, 2022))

dt = (
"2010-04-05",
Expand All @@ -117,8 +116,9 @@ def test_easter(self):
self.assertNoNonObservedHoliday(dt)

def test_trinity(self):
name = "Трійця"
self.assertHolidayName(
"Трійця",
name,
"2010-05-23",
"2011-06-12",
"2012-06-03",
Expand All @@ -132,6 +132,7 @@ def test_trinity(self):
"2020-06-07",
"2021-06-20",
)
self.assertHolidayName(name, range(1991, 2022))

dt = (
"2010-05-24",
Expand Down Expand Up @@ -252,6 +253,9 @@ def test_christmas_gregorian_day(self):

def test_substituted(self):
self.assertHoliday(
"1991-05-03",
"1991-05-10",
"1991-07-15",
"1992-01-06",
"1992-04-27",
"1993-01-08",
Expand All @@ -264,8 +268,10 @@ def test_substituted(self):
"1996-05-10",
"1997-01-02",
"1997-01-06",
"1997-01-08",
"1997-04-29",
"1997-04-30",
"1998-01-02",
"1999-01-08",
"1999-04-12",
"1999-08-23",
Expand Down Expand Up @@ -318,7 +324,7 @@ def test_substituted(self):
"2011-03-07",
"2011-06-27",
"2012-03-09",
"2012-04-20",
"2012-04-30",
"2012-06-29",
"2012-12-31",
"2013-05-03",
Expand Down
Loading