holidays 0.63__py3-none-any.whl → 0.64__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- holidays/calendars/hebrew.py +32 -3
- holidays/constants.py +1 -0
- holidays/countries/__init__.py +1 -0
- holidays/countries/afghanistan.py +104 -0
- holidays/countries/azerbaijan.py +2 -2
- holidays/countries/belarus.py +93 -14
- holidays/countries/el_salvador.py +45 -24
- holidays/countries/israel.py +55 -80
- holidays/countries/kazakhstan.py +2 -2
- holidays/countries/montenegro.py +143 -27
- holidays/countries/norway.py +1 -1
- holidays/countries/poland.py +9 -1
- holidays/countries/russia.py +1 -1
- holidays/countries/ukraine.py +19 -10
- holidays/financial/ny_stock_exchange.py +81 -44
- holidays/groups/__init__.py +1 -0
- holidays/groups/christian.py +2 -0
- holidays/groups/custom.py +12 -0
- holidays/groups/hebrew.py +151 -0
- holidays/holiday_base.py +2 -2
- holidays/locale/be/LC_MESSAGES/BY.mo +0 -0
- holidays/locale/be/LC_MESSAGES/BY.po +53 -17
- holidays/locale/cnr/LC_MESSAGES/ME.mo +0 -0
- holidays/locale/cnr/LC_MESSAGES/ME.po +102 -0
- holidays/locale/en_US/LC_MESSAGES/AF.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AF.po +98 -0
- holidays/locale/en_US/LC_MESSAGES/BY.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BY.po +61 -20
- holidays/locale/en_US/LC_MESSAGES/ME.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ME.po +102 -0
- holidays/locale/en_US/LC_MESSAGES/PL.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/PL.po +7 -5
- holidays/locale/en_US/LC_MESSAGES/SV.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/SV.po +75 -0
- holidays/locale/es/LC_MESSAGES/SV.mo +0 -0
- holidays/locale/es/LC_MESSAGES/SV.po +75 -0
- holidays/locale/fa_AF/LC_MESSAGES/AF.mo +0 -0
- holidays/locale/fa_AF/LC_MESSAGES/AF.po +98 -0
- holidays/locale/pl/LC_MESSAGES/PL.mo +0 -0
- holidays/locale/pl/LC_MESSAGES/PL.po +8 -4
- holidays/locale/ps_AF/LC_MESSAGES/AF.mo +0 -0
- holidays/locale/ps_AF/LC_MESSAGES/AF.po +98 -0
- holidays/locale/ru/LC_MESSAGES/BY.mo +0 -0
- holidays/locale/ru/LC_MESSAGES/BY.po +111 -0
- holidays/locale/th/LC_MESSAGES/BY.mo +0 -0
- holidays/locale/th/LC_MESSAGES/BY.po +109 -0
- holidays/locale/th/LC_MESSAGES/NO.mo +0 -0
- holidays/locale/th/LC_MESSAGES/NO.po +80 -0
- holidays/locale/th/LC_MESSAGES/RU.mo +0 -0
- holidays/locale/th/LC_MESSAGES/RU.po +90 -0
- holidays/locale/th/LC_MESSAGES/UA.mo +0 -0
- holidays/locale/th/LC_MESSAGES/UA.po +114 -0
- holidays/locale/uk/LC_MESSAGES/ME.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/ME.po +102 -0
- holidays/locale/uk/LC_MESSAGES/PL.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/PL.po +7 -5
- holidays/locale/uk/LC_MESSAGES/SV.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/SV.po +75 -0
- holidays/registry.py +1 -0
- holidays/version.py +1 -1
- {holidays-0.63.dist-info → holidays-0.64.dist-info}/AUTHORS +1 -0
- {holidays-0.63.dist-info → holidays-0.64.dist-info}/METADATA +16 -11
- {holidays-0.63.dist-info → holidays-0.64.dist-info}/RECORD +66 -36
- {holidays-0.63.dist-info → holidays-0.64.dist-info}/WHEEL +1 -1
- {holidays-0.63.dist-info → holidays-0.64.dist-info}/LICENSE +0 -0
- {holidays-0.63.dist-info → holidays-0.64.dist-info}/top_level.txt +0 -0
holidays/calendars/hebrew.py
CHANGED
|
@@ -1598,7 +1598,36 @@ class _HebrewLunisolar:
|
|
|
1598
1598
|
2100: (OCT, 13),
|
|
1599
1599
|
}
|
|
1600
1600
|
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
dt = getattr(_HebrewLunisolar, f"{holiday}_DATES", {}).get(year, ())
|
|
1601
|
+
def _get_holiday(self, holiday: str, year: int) -> Optional[date]:
|
|
1602
|
+
dt = getattr(self, f"{holiday}_DATES", {}).get(year, ())
|
|
1604
1603
|
return date(year, *dt) if dt else None
|
|
1604
|
+
|
|
1605
|
+
def hanukkah_date(self, year: int) -> set[Optional[date]]:
|
|
1606
|
+
return {self._get_holiday(HANUKKAH, y) for y in (year - 1, year)}
|
|
1607
|
+
|
|
1608
|
+
def israel_independence_date(self, year: int) -> Optional[date]:
|
|
1609
|
+
return self._get_holiday(INDEPENDENCE_DAY, year)
|
|
1610
|
+
|
|
1611
|
+
def lag_baomer_date(self, year: int) -> Optional[date]:
|
|
1612
|
+
return self._get_holiday(LAG_BAOMER, year)
|
|
1613
|
+
|
|
1614
|
+
def passover_date(self, year: int) -> Optional[date]:
|
|
1615
|
+
return self._get_holiday(PASSOVER, year)
|
|
1616
|
+
|
|
1617
|
+
def purim_date(self, year: int) -> Optional[date]:
|
|
1618
|
+
return self._get_holiday(PURIM, year)
|
|
1619
|
+
|
|
1620
|
+
def rosh_hashanah_date(self, year: int) -> Optional[date]:
|
|
1621
|
+
return self._get_holiday(ROSH_HASHANAH, year)
|
|
1622
|
+
|
|
1623
|
+
def shavuot_date(self, year: int) -> Optional[date]:
|
|
1624
|
+
return self._get_holiday(SHAVUOT, year)
|
|
1625
|
+
|
|
1626
|
+
def sukkot_date(self, year: int) -> Optional[date]:
|
|
1627
|
+
return self._get_holiday(SUKKOT, year)
|
|
1628
|
+
|
|
1629
|
+
def tisha_bav_date(self, year: int) -> Optional[date]:
|
|
1630
|
+
return self._get_holiday(TISHA_BAV, year)
|
|
1631
|
+
|
|
1632
|
+
def yom_kippur_date(self, year: int) -> Optional[date]:
|
|
1633
|
+
return self._get_holiday(YOM_KIPPUR, year)
|
holidays/constants.py
CHANGED
holidays/countries/__init__.py
CHANGED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# holidays
|
|
2
|
+
# --------
|
|
3
|
+
# A fast, efficient Python library for generating country, province and state
|
|
4
|
+
# specific sets of holidays on the fly. It aims to make determining whether a
|
|
5
|
+
# specific date is a holiday as fast and flexible as possible.
|
|
6
|
+
#
|
|
7
|
+
# Authors: Vacanza Team and individual contributors (see AUTHORS file)
|
|
8
|
+
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
|
|
9
|
+
# ryanss <ryanssdev@icloud.com> (c) 2014-2017
|
|
10
|
+
# Website: https://github.com/vacanza/holidays
|
|
11
|
+
# License: MIT (see LICENSE file)
|
|
12
|
+
|
|
13
|
+
from gettext import gettext as tr
|
|
14
|
+
|
|
15
|
+
from holidays.groups import InternationalHolidays, IslamicHolidays
|
|
16
|
+
from holidays.holiday_base import HolidayBase
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Afghanistan(HolidayBase, InternationalHolidays, IslamicHolidays):
|
|
20
|
+
"""
|
|
21
|
+
https://en.wikipedia.org/wiki/Public_holidays_in_Afghanistan
|
|
22
|
+
https://www.timeanddate.com/holidays/afghanistan/
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
country = "AF"
|
|
26
|
+
default_language = "fa_AF"
|
|
27
|
+
# %s (estimated).
|
|
28
|
+
estimated_label = tr("%s (برآورد شده)")
|
|
29
|
+
# %s (observed).
|
|
30
|
+
observed_label = tr("%s (مشاهده شده)")
|
|
31
|
+
# %s (observed, estimated).
|
|
32
|
+
observed_estimated_label = tr("%s (مشاهده شده، برآورد شده)")
|
|
33
|
+
supported_languages = ("en_US", "fa_AF", "ps_AF")
|
|
34
|
+
# Afghanistan's regaining of full independence from British influence.
|
|
35
|
+
start_year = 1919
|
|
36
|
+
|
|
37
|
+
def __init__(self, *args, **kwargs):
|
|
38
|
+
InternationalHolidays.__init__(self)
|
|
39
|
+
IslamicHolidays.__init__(self)
|
|
40
|
+
super().__init__(*args, **kwargs)
|
|
41
|
+
|
|
42
|
+
def _populate_public_holidays(self):
|
|
43
|
+
if self._year >= 1989:
|
|
44
|
+
# Liberation Day.
|
|
45
|
+
self._add_holiday_feb_15(tr("روز آزادی"))
|
|
46
|
+
|
|
47
|
+
# Afghanistan Independence Day.
|
|
48
|
+
self._add_holiday_aug_19(tr("روز استقلال افغانستان"))
|
|
49
|
+
|
|
50
|
+
if self._year <= 1996 or 2001 <= self._year <= 2020:
|
|
51
|
+
# Nowruz.
|
|
52
|
+
self._add_holiday_mar_21(tr("نوروز"))
|
|
53
|
+
|
|
54
|
+
if self._year >= 1992:
|
|
55
|
+
# Mojahedin's Victory Day.
|
|
56
|
+
self._add_holiday_apr_28(tr("روز پیروزی مجاهدین"))
|
|
57
|
+
|
|
58
|
+
if 1974 <= self._year <= 1996 or 2002 <= self._year <= 2021:
|
|
59
|
+
# International Workers' Day.
|
|
60
|
+
self._add_labor_day(tr("روز جهانی کارگر"))
|
|
61
|
+
|
|
62
|
+
if 1978 <= self._year <= 1988:
|
|
63
|
+
# Soviet Victory Day.
|
|
64
|
+
self._add_holiday_may_9(tr("روز پیروزی شوروی"))
|
|
65
|
+
|
|
66
|
+
if self._year >= 2022:
|
|
67
|
+
# American Withdrawal Day.
|
|
68
|
+
self._add_holiday_aug_31(tr("روز خروج آمریکایی ها"))
|
|
69
|
+
|
|
70
|
+
if self._year >= 2012:
|
|
71
|
+
# Martyrs' Day.
|
|
72
|
+
self._add_holiday_sep_9(tr("روز شهیدان"))
|
|
73
|
+
|
|
74
|
+
# Eid al-Fitr.
|
|
75
|
+
name = tr("عید فطر")
|
|
76
|
+
self._add_eid_al_fitr_day(name)
|
|
77
|
+
self._add_eid_al_fitr_day_two(name)
|
|
78
|
+
self._add_eid_al_fitr_day_three(name)
|
|
79
|
+
|
|
80
|
+
# Day of Arafah.
|
|
81
|
+
self._add_arafah_day(tr("روز عرفه"))
|
|
82
|
+
|
|
83
|
+
# Eid al-Adha.
|
|
84
|
+
name = tr("عید قربانی")
|
|
85
|
+
self._add_eid_al_adha_day(name)
|
|
86
|
+
self._add_eid_al_adha_day_two(name)
|
|
87
|
+
self._add_eid_al_adha_day_three(name)
|
|
88
|
+
|
|
89
|
+
# Ashura.
|
|
90
|
+
self._add_ashura_day(tr("عاشورا"))
|
|
91
|
+
|
|
92
|
+
# First Day of Ramadan.
|
|
93
|
+
self._add_ramadan_beginning_day(tr("اول رمضان"))
|
|
94
|
+
|
|
95
|
+
# Prophet's Birthday.
|
|
96
|
+
self._add_mawlid_day(tr("میلاد پیامبر"))
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class AF(Afghanistan):
|
|
100
|
+
pass
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class AFG(Afghanistan):
|
|
104
|
+
pass
|
holidays/countries/azerbaijan.py
CHANGED
|
@@ -287,10 +287,10 @@ class AzerbaijanStaticHolidays:
|
|
|
287
287
|
2018: (APR, 11, presidential_elections),
|
|
288
288
|
2019: (DEC, 27, municipal_elections),
|
|
289
289
|
2020: (
|
|
290
|
-
(MAR, 27, MAR, 29),
|
|
291
|
-
(MAY, 27, MAY, 30),
|
|
292
290
|
(JAN, 3, DEC, 28, 2019),
|
|
293
291
|
(JAN, 6, DEC, 29, 2019),
|
|
292
|
+
(MAR, 27, MAR, 29),
|
|
293
|
+
(MAY, 27, MAY, 30),
|
|
294
294
|
),
|
|
295
295
|
2021: (
|
|
296
296
|
(MAY, 11, MAY, 8),
|
holidays/countries/belarus.py
CHANGED
|
@@ -14,6 +14,7 @@ from gettext import gettext as tr
|
|
|
14
14
|
|
|
15
15
|
from holidays.calendars.gregorian import GREGORIAN_CALENDAR, JAN, MAR, APR, MAY, JUN, JUL, NOV, DEC
|
|
16
16
|
from holidays.calendars.julian import JULIAN_CALENDAR
|
|
17
|
+
from holidays.constants import PUBLIC, WORKDAY
|
|
17
18
|
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
|
|
18
19
|
from holidays.holiday_base import HolidayBase
|
|
19
20
|
|
|
@@ -23,18 +24,24 @@ class Belarus(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid
|
|
|
23
24
|
Belarus holidays.
|
|
24
25
|
|
|
25
26
|
References:
|
|
26
|
-
-
|
|
27
|
+
- https://president.gov.by/en/gosudarstvo/prazdniki
|
|
28
|
+
- https://president.gov.by/be/gosudarstvo/prazdniki
|
|
29
|
+
- https://president.gov.by/ru/gosudarstvo/prazdniki
|
|
27
30
|
- http://www.belarus.by/en/about-belarus/national-holidays
|
|
28
31
|
- http://laws.newsby.org/documents/ukazp/pos05/ukaz05806.htm
|
|
29
32
|
- http://president.gov.by/uploads/documents/2019/464uk.pdf
|
|
30
|
-
- https://ru.wikipedia.org/wiki
|
|
33
|
+
- https://ru.wikipedia.org/wiki/Праздники_Белоруссии
|
|
34
|
+
|
|
35
|
+
Cross-checked With:
|
|
36
|
+
- https://president.gov.by/en/gosudarstvo/prazdniki/calendar-2024
|
|
31
37
|
"""
|
|
32
38
|
|
|
33
39
|
country = "BY"
|
|
34
40
|
default_language = "be"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
supported_categories = (PUBLIC, WORKDAY)
|
|
42
|
+
supported_languages = ("be", "en_US", "ru", "th")
|
|
43
|
+
# Declaration of State Sovereignty of the BSSR.
|
|
44
|
+
start_year = 1991
|
|
38
45
|
|
|
39
46
|
def __init__(self, *args, **kwargs):
|
|
40
47
|
ChristianHolidays.__init__(self, JULIAN_CALENDAR)
|
|
@@ -44,10 +51,10 @@ class Belarus(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid
|
|
|
44
51
|
|
|
45
52
|
def _populate_public_holidays(self):
|
|
46
53
|
# New Year's Day.
|
|
47
|
-
|
|
48
|
-
|
|
54
|
+
name = tr("Новы год")
|
|
55
|
+
self._add_new_years_day(name)
|
|
49
56
|
if self._year >= 2020:
|
|
50
|
-
self._add_new_years_day_two(
|
|
57
|
+
self._add_new_years_day_two(name)
|
|
51
58
|
|
|
52
59
|
# Orthodox Christmas Day.
|
|
53
60
|
self._add_christmas_day(tr("Нараджэнне Хрыстова (праваслаўнае Раство)"))
|
|
@@ -55,8 +62,9 @@ class Belarus(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid
|
|
|
55
62
|
# Women's Day.
|
|
56
63
|
self._add_womens_day(tr("Дзень жанчын"))
|
|
57
64
|
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
if 1995 <= self._year <= 1998:
|
|
66
|
+
# Constitution Day.
|
|
67
|
+
self._add_holiday_mar_15(tr("Дзень Канстытуцыі"))
|
|
60
68
|
|
|
61
69
|
# Labor Day.
|
|
62
70
|
self._add_labor_day(tr("Свята працы"))
|
|
@@ -64,15 +72,70 @@ class Belarus(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid
|
|
|
64
72
|
# Victory Day.
|
|
65
73
|
self._add_world_war_two_victory_day(tr("Дзень Перамогі"), is_western=False)
|
|
66
74
|
|
|
67
|
-
#
|
|
68
|
-
self.
|
|
75
|
+
# Radunitsa (Day of Rejoicing).
|
|
76
|
+
self._add_rejoicing_day(tr("Радаўніца"))
|
|
77
|
+
|
|
78
|
+
# Independence Day of the Republic of Belarus (Day of the Republic).
|
|
79
|
+
name = tr("Дзень Незалежнасці Рэспублікі Беларусь (Дзень Рэспублікі)")
|
|
80
|
+
if self._year >= 1997:
|
|
81
|
+
self._add_holiday_jul_3(name)
|
|
82
|
+
else:
|
|
83
|
+
self._add_holiday_jul_27(name)
|
|
69
84
|
|
|
70
|
-
|
|
71
|
-
|
|
85
|
+
if self._year >= 1995:
|
|
86
|
+
# October Revolution Day.
|
|
87
|
+
self._add_holiday_nov_7(tr("Дзень Кастрычніцкай рэвалюцыі"))
|
|
72
88
|
|
|
73
89
|
# Catholic Christmas Day.
|
|
74
90
|
self._add_christmas_day(tr("Нараджэнне Хрыстова (каталіцкае Раство)"), GREGORIAN_CALENDAR)
|
|
75
91
|
|
|
92
|
+
if self._year >= 1992:
|
|
93
|
+
# Catholic Easter.
|
|
94
|
+
name_catholic = tr("Каталiцкi Вялiкдзень")
|
|
95
|
+
self._add_easter_sunday(name_catholic, GREGORIAN_CALENDAR)
|
|
96
|
+
|
|
97
|
+
# Orthodox Easter.
|
|
98
|
+
name_orthodox = tr("Праваслаўны Вялiкдзень")
|
|
99
|
+
self._add_easter_sunday(name_orthodox)
|
|
100
|
+
|
|
101
|
+
if self._year <= 1997:
|
|
102
|
+
self._add_easter_monday(name_catholic, GREGORIAN_CALENDAR)
|
|
103
|
+
self._add_easter_monday(name_orthodox)
|
|
104
|
+
|
|
105
|
+
# Dzyady (All Souls' Day).
|
|
106
|
+
self._add_all_souls_day(tr("Дзень памяці"))
|
|
107
|
+
|
|
108
|
+
def _populate_workday_holidays(self):
|
|
109
|
+
# Day of the Fatherland's Defenders and the Armed Forces of the Republic of Belarus.
|
|
110
|
+
self._add_holiday_feb_23(tr("Дзень абаронцаў Айчыны і Узброеных Сіл Рэспублікі Беларусь"))
|
|
111
|
+
|
|
112
|
+
if self._year >= 1999:
|
|
113
|
+
# Constitution Day.
|
|
114
|
+
self._add_holiday_mar_15(tr("Дзень Канстытуцыі"))
|
|
115
|
+
|
|
116
|
+
if self._year >= 1996:
|
|
117
|
+
# Day of Unity of the Peoples of Belarus and Russia.
|
|
118
|
+
self._add_holiday_apr_2(tr("Дзень яднання народаў Беларусі і Расіі"))
|
|
119
|
+
|
|
120
|
+
if self._year >= 1998:
|
|
121
|
+
self._add_holiday_2nd_sun_of_may(
|
|
122
|
+
# Day of the National Coat of Arms of the Republic of Belarus,
|
|
123
|
+
# the National Flag of the Republic of Belarus
|
|
124
|
+
# and the National Anthem of the Republic of Belarus.
|
|
125
|
+
tr(
|
|
126
|
+
"Дзень Дзяржаўнага сцяга, Дзяржаўнага герба і Дзяржаўнага "
|
|
127
|
+
"гімна Рэспублікі Беларусь"
|
|
128
|
+
)
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
if self._year >= 2021:
|
|
132
|
+
# Day of People's Unity.
|
|
133
|
+
self._add_holiday_sep_17(tr("Дзень народнага адзінства"))
|
|
134
|
+
|
|
135
|
+
if self._year >= 1998:
|
|
136
|
+
# Dzyady (All Souls' Day).
|
|
137
|
+
self._add_all_souls_day(tr("Дзень памяці"))
|
|
138
|
+
|
|
76
139
|
|
|
77
140
|
class BY(Belarus):
|
|
78
141
|
pass
|
|
@@ -83,6 +146,12 @@ class BLR(Belarus):
|
|
|
83
146
|
|
|
84
147
|
|
|
85
148
|
class BelarusStaticHolidays:
|
|
149
|
+
"""
|
|
150
|
+
References
|
|
151
|
+
- https://belarusbank.by/en/financial-institutions/11151
|
|
152
|
+
- https://belarusbank.by/en/financial-institutions/11160
|
|
153
|
+
"""
|
|
154
|
+
|
|
86
155
|
# Date format (see strftime() Format Codes)
|
|
87
156
|
substituted_date_format = tr("%d.%m.%Y")
|
|
88
157
|
# Day off (substituted from %s).
|
|
@@ -221,4 +290,14 @@ class BelarusStaticHolidays:
|
|
|
221
290
|
(MAY, 8, MAY, 13),
|
|
222
291
|
(NOV, 6, NOV, 11),
|
|
223
292
|
),
|
|
293
|
+
2024: (
|
|
294
|
+
(MAY, 13, MAY, 18),
|
|
295
|
+
(NOV, 8, NOV, 16),
|
|
296
|
+
),
|
|
297
|
+
2025: (
|
|
298
|
+
(JAN, 6, JAN, 11),
|
|
299
|
+
(APR, 28, APR, 26),
|
|
300
|
+
(JUL, 4, JUL, 12),
|
|
301
|
+
(DEC, 26, DEC, 20),
|
|
302
|
+
),
|
|
224
303
|
}
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
+
from gettext import gettext as tr
|
|
14
|
+
|
|
13
15
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
14
16
|
from holidays.holiday_base import HolidayBase
|
|
15
17
|
|
|
@@ -17,12 +19,14 @@ from holidays.holiday_base import HolidayBase
|
|
|
17
19
|
class ElSalvador(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
18
20
|
"""
|
|
19
21
|
References:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
- `Labor Code 1972 <https://www.transparencia.gob.sv/institutions/gd-usulutan/documents/192280/download>`_
|
|
23
|
+
- https://www.timeanddate.com/holidays/el-salvador
|
|
24
|
+
- https://www.officeholidays.com/countries/el-salvador
|
|
23
25
|
"""
|
|
24
26
|
|
|
25
27
|
country = "SV"
|
|
28
|
+
default_language = "es"
|
|
29
|
+
supported_languages = ("en_US", "es", "uk")
|
|
26
30
|
subdivisions = (
|
|
27
31
|
"AH", # Ahuachapán
|
|
28
32
|
"CA", # Cabañas
|
|
@@ -39,6 +43,24 @@ class ElSalvador(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
39
43
|
"UN", # La Unión
|
|
40
44
|
"US", # Usulután
|
|
41
45
|
)
|
|
46
|
+
subdivisions_aliases = {
|
|
47
|
+
"Ahuachapán": "AH",
|
|
48
|
+
"Cabañas": "CA",
|
|
49
|
+
"Chalatenango": "CH",
|
|
50
|
+
"Cuscatlán": "CU",
|
|
51
|
+
"La Libertad": "LI",
|
|
52
|
+
"Morazán": "MO",
|
|
53
|
+
"La Paz": "PA",
|
|
54
|
+
"Santa Ana": "SA",
|
|
55
|
+
"San Miguel": "SM",
|
|
56
|
+
"Sonsonate": "SO",
|
|
57
|
+
"San Salvador": "SS",
|
|
58
|
+
"San Vicente": "SV",
|
|
59
|
+
"La Unión": "UN",
|
|
60
|
+
"Usulután": "US",
|
|
61
|
+
}
|
|
62
|
+
# Labor Code 1972.
|
|
63
|
+
start_year = 1973
|
|
42
64
|
|
|
43
65
|
def __init__(self, *args, **kwargs):
|
|
44
66
|
ChristianHolidays.__init__(self)
|
|
@@ -47,48 +69,47 @@ class ElSalvador(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
47
69
|
|
|
48
70
|
def _populate_public_holidays(self):
|
|
49
71
|
# New Year's Day.
|
|
50
|
-
self._add_new_years_day("
|
|
72
|
+
self._add_new_years_day(tr("Año Nuevo"))
|
|
51
73
|
|
|
52
74
|
# Maundy Thursday.
|
|
53
|
-
self._add_holy_thursday("
|
|
75
|
+
self._add_holy_thursday(tr("Jueves Santo"))
|
|
54
76
|
|
|
55
77
|
# Good Friday.
|
|
56
|
-
self._add_good_friday("
|
|
78
|
+
self._add_good_friday(tr("Viernes Santo"))
|
|
57
79
|
|
|
58
80
|
# Holy Saturday.
|
|
59
|
-
self._add_holy_saturday("
|
|
81
|
+
self._add_holy_saturday(tr("Sábado Santo"))
|
|
60
82
|
|
|
61
83
|
# Labor Day.
|
|
62
|
-
self._add_labor_day("
|
|
84
|
+
self._add_labor_day(tr("Día del Trabajo"))
|
|
63
85
|
|
|
86
|
+
# Legislative Decree #399 from Apr 14, 2016.
|
|
64
87
|
if self._year >= 2016:
|
|
65
|
-
#
|
|
66
|
-
|
|
67
|
-
self._add_holiday_may_10("Mothers' Day")
|
|
88
|
+
# Mother's Day.
|
|
89
|
+
self._add_holiday_may_10(tr("Día de la Madre"))
|
|
68
90
|
|
|
91
|
+
# Legislative Decree #208 from Jun 17, 2012.
|
|
69
92
|
if self._year >= 2013:
|
|
70
|
-
#
|
|
71
|
-
|
|
72
|
-
self._add_holiday_jun_17("Fathers' Day")
|
|
93
|
+
# Father's Day.
|
|
94
|
+
self._add_holiday_jun_17(tr("Día del Padre"))
|
|
73
95
|
|
|
74
|
-
#
|
|
75
|
-
self._add_holiday_aug_6("
|
|
96
|
+
# Celebrations of San Salvador.
|
|
97
|
+
self._add_holiday_aug_6(tr("Celebración del Divino Salvador del Mundo"))
|
|
76
98
|
|
|
77
99
|
# Independence Day.
|
|
78
|
-
self._add_holiday_sep_15("
|
|
100
|
+
self._add_holiday_sep_15(tr("Día de la Independencia"))
|
|
79
101
|
|
|
80
102
|
# All Souls' Day.
|
|
81
|
-
self._add_all_souls_day("
|
|
103
|
+
self._add_all_souls_day(tr("Día de los Difuntos"))
|
|
82
104
|
|
|
83
105
|
# Christmas Day.
|
|
84
|
-
self._add_christmas_day("
|
|
106
|
+
self._add_christmas_day(tr("Navidad"))
|
|
85
107
|
|
|
86
108
|
def _populate_subdiv_ss_public_holidays(self):
|
|
87
|
-
# San Salvador
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
self._add_holiday_aug_5("San Salvador Day 2")
|
|
109
|
+
# Feast of San Salvador.
|
|
110
|
+
name = tr("Fiesta de San Salvador")
|
|
111
|
+
self._add_holiday_aug_3(name)
|
|
112
|
+
self._add_holiday_aug_5(name)
|
|
92
113
|
|
|
93
114
|
|
|
94
115
|
class SV(ElSalvador):
|
holidays/countries/israel.py
CHANGED
|
@@ -12,20 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
from gettext import gettext as tr
|
|
14
14
|
|
|
15
|
-
from holidays.calendars import _HebrewLunisolar
|
|
16
15
|
from holidays.calendars.gregorian import _timedelta, FRI, SAT
|
|
17
|
-
from holidays.calendars.hebrew import (
|
|
18
|
-
HANUKKAH,
|
|
19
|
-
INDEPENDENCE_DAY,
|
|
20
|
-
LAG_BAOMER,
|
|
21
|
-
PASSOVER,
|
|
22
|
-
PURIM,
|
|
23
|
-
ROSH_HASHANAH,
|
|
24
|
-
SHAVUOT,
|
|
25
|
-
SUKKOT,
|
|
26
|
-
YOM_KIPPUR,
|
|
27
|
-
)
|
|
28
16
|
from holidays.constants import OPTIONAL, PUBLIC, SCHOOL
|
|
17
|
+
from holidays.groups import HebrewCalendarHolidays
|
|
29
18
|
from holidays.observed_holiday_base import (
|
|
30
19
|
ObservedHolidayBase,
|
|
31
20
|
MON_TO_NEXT_TUE,
|
|
@@ -38,7 +27,7 @@ from holidays.observed_holiday_base import (
|
|
|
38
27
|
)
|
|
39
28
|
|
|
40
29
|
|
|
41
|
-
class Israel(ObservedHolidayBase):
|
|
30
|
+
class Israel(ObservedHolidayBase, HebrewCalendarHolidays):
|
|
42
31
|
"""
|
|
43
32
|
Israel holidays.
|
|
44
33
|
|
|
@@ -57,117 +46,103 @@ class Israel(ObservedHolidayBase):
|
|
|
57
46
|
start_year = 1948
|
|
58
47
|
|
|
59
48
|
def __init__(self, *args, **kwargs):
|
|
49
|
+
HebrewCalendarHolidays.__init__(self)
|
|
60
50
|
kwargs.setdefault("observed_rule", FRI_TO_PREV_THU + SAT_TO_PREV_THU)
|
|
61
51
|
super().__init__(*args, **kwargs)
|
|
62
52
|
|
|
63
|
-
def
|
|
64
|
-
|
|
53
|
+
def _add_observed(self, dt, name, rule):
|
|
54
|
+
is_observed, _ = super()._add_observed(dt, name, rule)
|
|
55
|
+
if not is_observed:
|
|
56
|
+
self._add_holiday(name, dt)
|
|
65
57
|
|
|
66
58
|
def _populate_public_holidays(self):
|
|
67
59
|
# Rosh Hashanah (New Year).
|
|
68
|
-
|
|
69
|
-
rosh_hashanah_dt = self._get_holiday(ROSH_HASHANAH)
|
|
70
|
-
self._add_holiday(name, rosh_hashanah_dt)
|
|
71
|
-
self._add_holiday(name, _timedelta(rosh_hashanah_dt, +1))
|
|
60
|
+
self._add_rosh_hashanah(tr("ראש השנה"), range(2))
|
|
72
61
|
|
|
73
62
|
# Yom Kippur (Day of Atonement).
|
|
74
|
-
self.
|
|
63
|
+
self._add_yom_kippur(tr("יום כיפור"))
|
|
75
64
|
|
|
76
|
-
sukkot_dt = self._get_holiday(SUKKOT)
|
|
77
65
|
# Sukkot (Feast of Tabernacles).
|
|
78
|
-
self.
|
|
66
|
+
self._add_sukkot(tr("סוכות"))
|
|
79
67
|
# Simchat Torah / Shemini Atzeret.
|
|
80
|
-
self.
|
|
68
|
+
self._add_sukkot(tr("שמחת תורה/שמיני עצרת"), +7)
|
|
81
69
|
|
|
82
|
-
passover_dt = self._get_holiday(PASSOVER)
|
|
83
70
|
# Pesach (Passover).
|
|
84
|
-
self.
|
|
71
|
+
self._add_passover(tr("פסח"))
|
|
85
72
|
# Shvi'i shel Pesach (Seventh day of Passover)
|
|
86
|
-
self.
|
|
73
|
+
self._add_passover(tr("שביעי של פסח"), +6)
|
|
87
74
|
|
|
88
|
-
# Yom Ha-Atzmaut (Independence Day).
|
|
89
|
-
name = tr("יום העצמאות")
|
|
90
|
-
independence_day_dt = self._get_holiday(INDEPENDENCE_DAY)
|
|
91
75
|
rule = FRI_TO_PREV_THU + SAT_TO_PREV_THU
|
|
92
76
|
if self._year >= 2004:
|
|
93
77
|
rule += MON_TO_NEXT_TUE
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
78
|
+
self._add_observed(
|
|
79
|
+
self._hebrew_calendar.israel_independence_date(self._year),
|
|
80
|
+
# Yom Ha-Atzmaut (Independence Day).
|
|
81
|
+
tr("יום העצמאות"),
|
|
82
|
+
rule,
|
|
83
|
+
)
|
|
97
84
|
|
|
98
85
|
# Shavuot.
|
|
99
|
-
self.
|
|
86
|
+
self._add_shavuot(tr("שבועות"))
|
|
100
87
|
|
|
101
88
|
def _populate_optional_holidays(self):
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
# Chol HaMoed Sukkot (Feast of Tabernacles holiday).
|
|
105
|
-
self._add_holiday(tr("חול המועד סוכות"), _timedelta(sukkot_dt, offset))
|
|
89
|
+
# Chol HaMoed Sukkot (Feast of Tabernacles holiday).
|
|
90
|
+
self._add_sukkot(tr("חול המועד סוכות"), range(1, 6))
|
|
106
91
|
|
|
107
92
|
if self._year >= 2008:
|
|
108
93
|
# Sigd.
|
|
109
|
-
self.
|
|
94
|
+
self._add_yom_kippur(tr("סיגד"), +49)
|
|
110
95
|
|
|
111
96
|
# Purim.
|
|
112
|
-
self.
|
|
97
|
+
self._add_purim(tr("פורים"))
|
|
113
98
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
# Chol HaMoed Pesach (Passover holiday).
|
|
117
|
-
self._add_holiday(tr("חול המועד פסח"), _timedelta(passover_dt, offset))
|
|
99
|
+
# Chol HaMoed Pesach (Passover holiday).
|
|
100
|
+
self._add_passover(tr("חול המועד פסח"), range(1, 6))
|
|
118
101
|
|
|
119
102
|
if self._year >= 1963:
|
|
120
|
-
# Yom Hazikaron (Fallen Soldiers and Victims of Terrorism Remembrance Day).
|
|
121
|
-
name = tr("יום הזיכרון לחללי מערכות ישראל ונפגעי פעולות האיבה")
|
|
122
|
-
remembrance_day_dt = _timedelta(self._get_holiday(INDEPENDENCE_DAY), -1)
|
|
123
103
|
rule = THU_TO_PREV_WED + FRI_TO_PREV_WED
|
|
124
104
|
if self._year >= 2004:
|
|
125
105
|
rule += SUN_TO_NEXT_MON
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
106
|
+
self._add_observed(
|
|
107
|
+
_timedelta(self._hebrew_calendar.israel_independence_date(self._year), -1),
|
|
108
|
+
# Yom Hazikaron (Fallen Soldiers and Victims of Terrorism Remembrance Day).
|
|
109
|
+
tr("יום הזיכרון לחללי מערכות ישראל ונפגעי פעולות האיבה"),
|
|
110
|
+
rule,
|
|
111
|
+
)
|
|
129
112
|
|
|
130
113
|
if self._year >= 1998:
|
|
131
114
|
# Yom Yerushalayim (Jerusalem Day).
|
|
132
|
-
self.
|
|
115
|
+
self._add_lag_baomer(tr("יום ירושלים"), +10)
|
|
133
116
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
117
|
+
self._add_observed(
|
|
118
|
+
self._hebrew_calendar.tisha_bav_date(self._year),
|
|
119
|
+
# Tisha B'Av (Tisha B'Av, fast).
|
|
120
|
+
tr("תשעה באב"),
|
|
121
|
+
SAT_TO_NEXT_SUN,
|
|
122
|
+
)
|
|
140
123
|
|
|
141
124
|
def _populate_school_holidays(self):
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
name = tr("תענית אסתר")
|
|
155
|
-
purim_dt = self._get_holiday(PURIM)
|
|
156
|
-
taanit_ester_dt = _timedelta(purim_dt, -1)
|
|
157
|
-
is_observed, _ = self._add_observed(taanit_ester_dt, name, SAT_TO_PREV_THU)
|
|
158
|
-
if not is_observed:
|
|
159
|
-
self._add_holiday(name, taanit_ester_dt)
|
|
125
|
+
# Chol HaMoed Sukkot (Feast of Tabernacles holiday).
|
|
126
|
+
self._add_sukkot(tr("חול המועד סוכות"), range(1, 6))
|
|
127
|
+
|
|
128
|
+
# Hanukkah.
|
|
129
|
+
self._add_hanukkah(tr("חנוכה"), range(8))
|
|
130
|
+
|
|
131
|
+
self._add_observed(
|
|
132
|
+
_timedelta(self._hebrew_calendar.purim_date(self._year), -1),
|
|
133
|
+
# Ta`anit Ester (Fast of Esther).
|
|
134
|
+
tr("תענית אסתר"),
|
|
135
|
+
SAT_TO_PREV_THU,
|
|
136
|
+
)
|
|
160
137
|
|
|
161
138
|
# Purim.
|
|
162
|
-
self.
|
|
139
|
+
self._add_purim(tr("פורים"))
|
|
163
140
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
# Chol HaMoed Pesach (Passover holiday).
|
|
167
|
-
self._add_holiday(tr("חול המועד פסח"), _timedelta(passover_dt, offset))
|
|
141
|
+
# Chol HaMoed Pesach (Passover holiday).
|
|
142
|
+
self._add_passover(tr("חול המועד פסח"), range(1, 6))
|
|
168
143
|
|
|
169
144
|
# Lag Ba'omer (Lag BaOmer).
|
|
170
|
-
self.
|
|
145
|
+
self._add_lag_baomer(tr('ל"ג בעומר'))
|
|
171
146
|
|
|
172
147
|
|
|
173
148
|
class IL(Israel):
|