holidays 0.81__py3-none-any.whl → 0.82__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/__init__.py +1 -0
- holidays/calendars/burmese.py +319 -0
- holidays/calendars/hebrew.py +2 -2
- holidays/calendars/thai.py +49 -2
- holidays/countries/__init__.py +10 -0
- holidays/countries/afghanistan.py +7 -5
- holidays/countries/algeria.py +89 -24
- holidays/countries/antarctica.py +58 -0
- holidays/countries/bouvet_island.py +31 -0
- holidays/countries/brazil.py +1 -1
- holidays/countries/british_indian_ocean_territory.py +31 -0
- holidays/countries/bulgaria.py +6 -1
- holidays/countries/chile.py +9 -8
- holidays/countries/cuba.py +3 -4
- holidays/countries/djibouti.py +1 -1
- holidays/countries/heard_island_and_mcdonald_islands.py +31 -0
- holidays/countries/hungary.py +4 -5
- holidays/countries/india.py +6 -0
- holidays/countries/japan.py +22 -18
- holidays/countries/jordan.py +6 -3
- holidays/countries/kuwait.py +6 -3
- holidays/countries/malaysia.py +14 -3
- holidays/countries/myanmar.py +195 -0
- holidays/countries/north_korea.py +161 -0
- holidays/countries/norway.py +23 -8
- holidays/countries/oman.py +6 -2
- holidays/countries/paraguay.py +70 -23
- holidays/countries/portugal.py +5 -6
- holidays/countries/qatar.py +5 -2
- holidays/countries/rwanda.py +6 -1
- holidays/countries/saudi_arabia.py +6 -5
- holidays/countries/serbia.py +5 -0
- holidays/countries/south_africa.py +96 -53
- holidays/countries/south_korea.py +6 -1
- holidays/countries/spain.py +4 -4
- holidays/countries/sudan.py +6 -3
- holidays/countries/switzerland.py +169 -3
- holidays/countries/taiwan.py +22 -2
- holidays/countries/tanzania.py +6 -1
- holidays/countries/thailand.py +21 -0
- holidays/countries/tonga.py +6 -1
- holidays/countries/trinidad_and_tobago.py +6 -1
- holidays/countries/united_arab_emirates.py +9 -2
- holidays/countries/united_states.py +16 -0
- holidays/countries/uruguay.py +6 -1
- holidays/countries/vietnam.py +6 -1
- holidays/countries/yemen.py +6 -3
- holidays/groups/__init__.py +1 -0
- holidays/groups/balinese_saka.py +1 -1
- holidays/groups/buddhist.py +1 -1
- holidays/groups/burmese.py +273 -0
- holidays/groups/chinese.py +25 -0
- holidays/groups/custom.py +8 -2
- holidays/groups/eastern.py +24 -0
- holidays/groups/hebrew.py +16 -14
- holidays/groups/hindu.py +15 -13
- holidays/groups/islamic.py +43 -48
- holidays/groups/mongolian.py +1 -1
- holidays/groups/sinhala.py +4 -9
- holidays/groups/tibetan.py +3 -4
- holidays/holiday_base.py +5 -4
- holidays/ical.py +6 -4
- holidays/locale/ar/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_IN/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/JP.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/KP.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MM.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/PY.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/US.mo +0 -0
- holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/es/LC_MESSAGES/PY.mo +0 -0
- holidays/locale/fr/LC_MESSAGES/DZ.mo +0 -0
- holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
- holidays/locale/ja/LC_MESSAGES/JP.mo +0 -0
- holidays/locale/ko_KP/LC_MESSAGES/KP.mo +0 -0
- holidays/locale/my/LC_MESSAGES/MM.mo +0 -0
- holidays/locale/pt_BR/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/th/LC_MESSAGES/JP.mo +0 -0
- holidays/locale/th/LC_MESSAGES/MM.mo +0 -0
- holidays/locale/th/LC_MESSAGES/US.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/BR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/PY.mo +0 -0
- holidays/no_holiday_base.py +21 -0
- holidays/registry.py +6 -0
- holidays/utils.py +5 -5
- holidays/version.py +1 -1
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/METADATA +47 -5
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/RECORD +98 -83
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/licenses/CONTRIBUTORS +2 -0
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/WHEEL +0 -0
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.81.dist-info → holidays-0.82.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
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 CONTRIBUTORS 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 holidays.groups import ChristianHolidays, InternationalHolidays
|
|
14
|
+
from holidays.holiday_base import HolidayBase
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Antarctica(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
18
|
+
"""Antarctica holidays.
|
|
19
|
+
|
|
20
|
+
References:
|
|
21
|
+
* <https://en.wikipedia.org/wiki/Antarctica_Day>
|
|
22
|
+
* <https://en.wikipedia.org/wiki/Midwinter_Day>
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
country = "AQ"
|
|
26
|
+
# The Antarctica Treaty System became active on June 23rd, 1961.
|
|
27
|
+
start_year = 1962
|
|
28
|
+
|
|
29
|
+
def __init__(self, *args, **kwargs):
|
|
30
|
+
ChristianHolidays.__init__(self)
|
|
31
|
+
InternationalHolidays.__init__(self)
|
|
32
|
+
super().__init__(*args, **kwargs)
|
|
33
|
+
|
|
34
|
+
def _populate_public_holidays(self):
|
|
35
|
+
# New Year's Day.
|
|
36
|
+
self._add_new_years_day("New Year's Day")
|
|
37
|
+
|
|
38
|
+
# Midwinter Day.
|
|
39
|
+
name = "Midwinter Day"
|
|
40
|
+
if self._is_leap_year():
|
|
41
|
+
self._add_holiday_jun_20(name)
|
|
42
|
+
else:
|
|
43
|
+
self._add_holiday_jun_21(name)
|
|
44
|
+
|
|
45
|
+
if self._year >= 2010:
|
|
46
|
+
# Antarctica Day.
|
|
47
|
+
self._add_holiday_dec_1("Antarctica Day")
|
|
48
|
+
|
|
49
|
+
# Christmas Day.
|
|
50
|
+
self._add_christmas_day("Christmas Day")
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class AQ(Antarctica):
|
|
54
|
+
pass
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class ATA(Antarctica):
|
|
58
|
+
pass
|
|
@@ -0,0 +1,31 @@
|
|
|
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 CONTRIBUTORS 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 holidays.no_holiday_base import NoHolidayBase
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class BouvetIsland(NoHolidayBase):
|
|
17
|
+
"""Bouvet Island holidays.
|
|
18
|
+
|
|
19
|
+
References:
|
|
20
|
+
* <https://en.wikipedia.org/wiki/Bouvet_Island>
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
country = "BV"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class BV(BouvetIsland):
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class BVT(BouvetIsland):
|
|
31
|
+
pass
|
holidays/countries/brazil.py
CHANGED
|
@@ -106,7 +106,7 @@ class Brazil(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
106
106
|
|
|
107
107
|
if 1892 <= self._year <= 1930:
|
|
108
108
|
# Republic Constitution Day.
|
|
109
|
-
self._add_holiday_feb_24(tr("Constituição da
|
|
109
|
+
self._add_holiday_feb_24(tr("Constituição da República"))
|
|
110
110
|
|
|
111
111
|
# Good Friday.
|
|
112
112
|
self._add_good_friday(tr("Sexta-feira Santa"))
|
|
@@ -0,0 +1,31 @@
|
|
|
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 CONTRIBUTORS 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 holidays.no_holiday_base import NoHolidayBase
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class BritishIndianOceanTerritory(NoHolidayBase):
|
|
17
|
+
"""British Indian Ocean Territory holidays.
|
|
18
|
+
|
|
19
|
+
References:
|
|
20
|
+
* <https://en.wikipedia.org/wiki/British_Indian_Ocean_Territory>
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
country = "IO"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class IO(BritishIndianOceanTerritory):
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class IOT(BritishIndianOceanTerritory):
|
|
31
|
+
pass
|
holidays/countries/bulgaria.py
CHANGED
|
@@ -10,14 +10,19 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
14
15
|
from gettext import gettext as tr
|
|
16
|
+
from typing import TYPE_CHECKING
|
|
15
17
|
|
|
16
18
|
from holidays.calendars.julian_revised import JULIAN_REVISED_CALENDAR
|
|
17
19
|
from holidays.constants import PUBLIC, SCHOOL
|
|
18
20
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
19
21
|
from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NEXT_WORKDAY
|
|
20
22
|
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from datetime import date
|
|
25
|
+
|
|
21
26
|
|
|
22
27
|
class Bulgaria(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
|
|
23
28
|
"""Bulgaria holidays.
|
holidays/countries/chile.py
CHANGED
|
@@ -118,6 +118,7 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
|
|
|
118
118
|
# New Year's Day.
|
|
119
119
|
self._add_new_years_day(tr("Año Nuevo"))
|
|
120
120
|
if self._year >= 2017:
|
|
121
|
+
# National Holiday.
|
|
121
122
|
self._add_observed(self._add_new_years_day_two(tr("Feriado nacional")), rule=MON_ONLY)
|
|
122
123
|
|
|
123
124
|
# Good Friday.
|
|
@@ -171,12 +172,18 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
|
|
|
171
172
|
# Day of National Unity.
|
|
172
173
|
self._add_holiday_1st_mon_of_sep(tr("Día de la Unidad Nacional"))
|
|
173
174
|
|
|
175
|
+
# National Holiday.
|
|
176
|
+
name = tr("Fiestas Patrias")
|
|
177
|
+
|
|
174
178
|
if self._year >= 2007:
|
|
175
179
|
self._add_observed(
|
|
176
|
-
|
|
177
|
-
self._add_holiday_sep_17(tr("Fiestas Patrias")),
|
|
180
|
+
self._add_holiday_sep_17(name),
|
|
178
181
|
rule=MON_FRI_ONLY if self._year >= 2017 else MON_ONLY,
|
|
179
182
|
)
|
|
183
|
+
if self._year >= 2008:
|
|
184
|
+
self._add_observed(self._add_holiday_sep_20(name), rule=FRI_ONLY)
|
|
185
|
+
elif 1932 <= self._year <= 1944:
|
|
186
|
+
self._add_holiday_sep_20(name)
|
|
180
187
|
|
|
181
188
|
# Independence Day.
|
|
182
189
|
self._add_holiday_sep_18(tr("Día de la Independencia"))
|
|
@@ -184,12 +191,6 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
|
|
|
184
191
|
# Army Day.
|
|
185
192
|
self._add_holiday_sep_19(tr("Día de las Glorias del Ejército"))
|
|
186
193
|
|
|
187
|
-
if self._year >= 2008:
|
|
188
|
-
self._add_observed(self._add_holiday_sep_20(tr("Fiestas Patrias")), rule=FRI_ONLY)
|
|
189
|
-
|
|
190
|
-
if 1932 <= self._year <= 1944:
|
|
191
|
-
self._add_holiday_sep_20(tr("Fiestas Patrias"))
|
|
192
|
-
|
|
193
194
|
if self._year >= 1922 and self._year != 1973:
|
|
194
195
|
self._move_holiday(
|
|
195
196
|
self._add_columbus_day(
|
holidays/countries/cuba.py
CHANGED
|
@@ -80,14 +80,13 @@ class Cuba(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
80
80
|
self._add_observed(self._add_labor_day(tr("Día Internacional de los Trabajadores")))
|
|
81
81
|
|
|
82
82
|
# Commemoration of the Assault of the Moncada garrison.
|
|
83
|
-
|
|
83
|
+
name = tr("Conmemoración del asalto a Moncada")
|
|
84
|
+
self._add_holiday_jul_25(name)
|
|
85
|
+
self._add_holiday_jul_27(name)
|
|
84
86
|
|
|
85
87
|
# Day of the National Rebellion.
|
|
86
88
|
self._add_holiday_jul_26(tr("Día de la Rebeldía Nacional"))
|
|
87
89
|
|
|
88
|
-
# Commemoration of the Assault of the Moncada garrison.
|
|
89
|
-
self._add_holiday_jul_27(tr("Conmemoración del asalto a Moncada"))
|
|
90
|
-
|
|
91
90
|
# Independence Day.
|
|
92
91
|
self._add_observed(self._add_holiday_oct_10(tr("Inicio de las Guerras de Independencia")))
|
|
93
92
|
|
holidays/countries/djibouti.py
CHANGED
|
@@ -17,7 +17,7 @@ from holidays.groups import ChristianHolidays, IslamicHolidays, InternationalHol
|
|
|
17
17
|
from holidays.holiday_base import HolidayBase
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
class Djibouti(HolidayBase, ChristianHolidays,
|
|
20
|
+
class Djibouti(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays):
|
|
21
21
|
"""Djibouti holidays."""
|
|
22
22
|
|
|
23
23
|
country = "DJ"
|
|
@@ -0,0 +1,31 @@
|
|
|
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 CONTRIBUTORS 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 holidays.no_holiday_base import NoHolidayBase
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class HeardIslandAndMcDonaldIslands(NoHolidayBase):
|
|
17
|
+
"""Heard Island and McDonald Islands holidays.
|
|
18
|
+
|
|
19
|
+
References:
|
|
20
|
+
* <https://en.wikipedia.org/wiki/Heard_Island_and_McDonald_Islands>
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
country = "HM"
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class HM(HeardIslandAndMcDonaldIslands):
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class HMD(HeardIslandAndMcDonaldIslands):
|
|
31
|
+
pass
|
holidays/countries/hungary.py
CHANGED
|
@@ -43,7 +43,10 @@ class Hungary(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid
|
|
|
43
43
|
|
|
44
44
|
if self._year <= 1950 or self._year >= 1989:
|
|
45
45
|
# National Day.
|
|
46
|
-
|
|
46
|
+
name = tr("Nemzeti ünnep")
|
|
47
|
+
self._add_holiday_mar_15(name)
|
|
48
|
+
if self._year >= 1991:
|
|
49
|
+
self._add_holiday_oct_23(name)
|
|
47
50
|
|
|
48
51
|
if self._year >= 2017:
|
|
49
52
|
# Good Friday.
|
|
@@ -78,10 +81,6 @@ class Hungary(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolid
|
|
|
78
81
|
else tr("Az államalapítás ünnepe")
|
|
79
82
|
)
|
|
80
83
|
|
|
81
|
-
if self._year >= 1991:
|
|
82
|
-
# National Day.
|
|
83
|
-
self._add_holiday_oct_23(tr("Nemzeti ünnep"))
|
|
84
|
-
|
|
85
84
|
if self._year >= 1999:
|
|
86
85
|
# All Saints' Day.
|
|
87
86
|
self._add_all_saints_day(tr("Mindenszentek"))
|
holidays/countries/india.py
CHANGED
|
@@ -279,6 +279,8 @@ class India(
|
|
|
279
279
|
self._add_holiday_apr_14(tr("Dr. B. R. Ambedkar's Jayanti"))
|
|
280
280
|
# Andhra Pradesh Foundation Day.
|
|
281
281
|
self._add_holiday_nov_1(tr("Andhra Pradesh Foundation Day"))
|
|
282
|
+
# Ugadi.
|
|
283
|
+
self._add_gudi_padwa(tr("Ugadi"))
|
|
282
284
|
|
|
283
285
|
# Assam.
|
|
284
286
|
def _populate_subdiv_as_public_holidays(self):
|
|
@@ -365,6 +367,8 @@ class India(
|
|
|
365
367
|
self._add_holiday_apr_14(tr("Dr. B. R. Ambedkar's Jayanti"))
|
|
366
368
|
# Karnataka Rajyotsav.
|
|
367
369
|
self._add_holiday_nov_1(tr("Karnataka Rajyotsava"))
|
|
370
|
+
# Ugadi.
|
|
371
|
+
self._add_gudi_padwa(tr("Ugadi"))
|
|
368
372
|
|
|
369
373
|
# Kerala.
|
|
370
374
|
def _populate_subdiv_kl_public_holidays(self):
|
|
@@ -476,6 +480,8 @@ class India(
|
|
|
476
480
|
self._add_holiday_jun_2(tr("Telangana Formation Day"))
|
|
477
481
|
# Bathukamma Festival.
|
|
478
482
|
self._add_holiday_oct_6(tr("Bathukamma Festival"))
|
|
483
|
+
# Ugadi.
|
|
484
|
+
self._add_gudi_padwa(tr("Ugadi"))
|
|
479
485
|
|
|
480
486
|
# Uttarakhand.
|
|
481
487
|
def _populate_subdiv_uk_public_holidays(self):
|
holidays/countries/japan.py
CHANGED
|
@@ -99,30 +99,38 @@ class Japan(ObservedHolidayBase, InternationalHolidays, StaticHolidays):
|
|
|
99
99
|
# Foundation Day.
|
|
100
100
|
dts_observed.add(self._add_holiday_feb_11(tr("建国記念の日")))
|
|
101
101
|
|
|
102
|
-
if self._year
|
|
102
|
+
if self._year != 2019:
|
|
103
103
|
# Emperor's Birthday.
|
|
104
|
-
|
|
104
|
+
name = tr("天皇誕生日")
|
|
105
|
+
if self._year >= 2020:
|
|
106
|
+
# Reiwa Emperor's Birthday.
|
|
107
|
+
dt = self._add_holiday_feb_23(name)
|
|
108
|
+
elif self._year >= 1989:
|
|
109
|
+
# Heisei Emperor's Birthday.
|
|
110
|
+
dt = self._add_holiday_dec_23(name)
|
|
111
|
+
else:
|
|
112
|
+
# Showa Emperor's Birthday.
|
|
113
|
+
dt = self._add_holiday_apr_29(name)
|
|
114
|
+
dts_observed.add(dt)
|
|
105
115
|
|
|
106
116
|
# Vernal Equinox Day.
|
|
107
117
|
dts_observed.add(self._add_holiday(tr("春分の日"), self._vernal_equinox_date))
|
|
108
118
|
|
|
109
|
-
|
|
110
|
-
if self._year <= 1988:
|
|
111
|
-
name = tr("天皇誕生日")
|
|
112
|
-
elif self._year <= 2006:
|
|
113
|
-
# Greenery Day.
|
|
114
|
-
name = tr("みどりの日")
|
|
115
|
-
else:
|
|
119
|
+
if self._year >= 2007:
|
|
116
120
|
# Showa Day.
|
|
117
|
-
|
|
118
|
-
dts_observed.add(self._add_holiday_apr_29(name))
|
|
121
|
+
dts_observed.add(self._add_holiday_apr_29(tr("昭和の日")))
|
|
119
122
|
|
|
120
123
|
# Constitution Day.
|
|
121
124
|
dts_observed.add(self._add_holiday_may_3(tr("憲法記念日")))
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
if self._year >= 1989:
|
|
127
|
+
# Greenery Day.
|
|
128
|
+
name = tr("みどりの日")
|
|
129
|
+
dts_observed.add(
|
|
130
|
+
self._add_holiday_may_4(name)
|
|
131
|
+
if self._year >= 2007
|
|
132
|
+
else self._add_holiday_apr_29(name)
|
|
133
|
+
)
|
|
126
134
|
|
|
127
135
|
# Children's Day.
|
|
128
136
|
dts_observed.add(self._add_holiday_may_5(tr("こどもの日")))
|
|
@@ -188,10 +196,6 @@ class Japan(ObservedHolidayBase, InternationalHolidays, StaticHolidays):
|
|
|
188
196
|
# Labor Thanksgiving Day.
|
|
189
197
|
dts_observed.add(self._add_holiday_nov_23(tr("勤労感謝の日")))
|
|
190
198
|
|
|
191
|
-
# Regarding the Emperor of Heisei.
|
|
192
|
-
if 1989 <= self._year <= 2018:
|
|
193
|
-
dts_observed.add(self._add_holiday_dec_23(tr("天皇誕生日")))
|
|
194
|
-
|
|
195
199
|
if self.observed:
|
|
196
200
|
self._populate_observed(dts_observed)
|
|
197
201
|
|
holidays/countries/jordan.py
CHANGED
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
+
from datetime import date
|
|
13
14
|
from gettext import gettext as tr
|
|
14
15
|
|
|
15
|
-
from holidays.calendars.gregorian import THU, FRI, SAT
|
|
16
|
+
from holidays.calendars.gregorian import JAN, THU, FRI, SAT
|
|
16
17
|
from holidays.groups import ChristianHolidays, InternationalHolidays, IslamicHolidays
|
|
17
18
|
from holidays.holiday_base import HolidayBase
|
|
18
19
|
|
|
@@ -30,6 +31,7 @@ class Jordan(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolid
|
|
|
30
31
|
# %s (estimated).
|
|
31
32
|
estimated_label = tr("%s (المقدرة)")
|
|
32
33
|
supported_languages = ("ar", "en_US")
|
|
34
|
+
weekend = {FRI, SAT}
|
|
33
35
|
|
|
34
36
|
def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
|
|
35
37
|
"""
|
|
@@ -43,11 +45,12 @@ class Jordan(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolid
|
|
|
43
45
|
IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
|
|
44
46
|
super().__init__(*args, **kwargs)
|
|
45
47
|
|
|
46
|
-
def
|
|
48
|
+
def _get_weekend(self, dt: date) -> set[int]:
|
|
47
49
|
# The resting days are Friday and Saturday since Jan 6, 2000.
|
|
48
50
|
# https://web.archive.org/web/20241226195649/http://archive.wfn.org/2000/01/msg00078.html
|
|
49
|
-
|
|
51
|
+
return {FRI, SAT} if dt >= date(2000, JAN, 6) else {THU, FRI}
|
|
50
52
|
|
|
53
|
+
def _populate_public_holidays(self):
|
|
51
54
|
# New Year's Day.
|
|
52
55
|
self._add_new_years_day(tr("رأس السنة الميلادية"))
|
|
53
56
|
|
holidays/countries/kuwait.py
CHANGED
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
+
from datetime import date
|
|
13
14
|
from gettext import gettext as tr
|
|
14
15
|
|
|
15
|
-
from holidays.calendars.gregorian import THU, FRI, SAT
|
|
16
|
+
from holidays.calendars.gregorian import SEP, THU, FRI, SAT
|
|
16
17
|
from holidays.groups import InternationalHolidays, IslamicHolidays
|
|
17
18
|
from holidays.holiday_base import HolidayBase
|
|
18
19
|
|
|
@@ -31,6 +32,7 @@ class Kuwait(HolidayBase, InternationalHolidays, IslamicHolidays):
|
|
|
31
32
|
# %s (estimated).
|
|
32
33
|
estimated_label = tr("%s (المقدرة)")
|
|
33
34
|
supported_languages = ("ar", "en_US")
|
|
35
|
+
weekend = {FRI, SAT}
|
|
34
36
|
|
|
35
37
|
def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
|
|
36
38
|
"""
|
|
@@ -43,11 +45,12 @@ class Kuwait(HolidayBase, InternationalHolidays, IslamicHolidays):
|
|
|
43
45
|
IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
|
|
44
46
|
super().__init__(*args, **kwargs)
|
|
45
47
|
|
|
46
|
-
def
|
|
48
|
+
def _get_weekend(self, dt: date) -> set[int]:
|
|
47
49
|
# The resting days are Friday and Saturday since Sep 1, 2007.
|
|
48
50
|
# https://web.archive.org/web/20250414072729/https://www.arabnews.com/node/298933
|
|
49
|
-
|
|
51
|
+
return {FRI, SAT} if dt >= date(2007, SEP, 1) else {THU, FRI}
|
|
50
52
|
|
|
53
|
+
def _populate_public_holidays(self):
|
|
51
54
|
# New Year's Day.
|
|
52
55
|
self._add_new_years_day(tr("رأس السنة الميلادية"))
|
|
53
56
|
|
holidays/countries/malaysia.py
CHANGED
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
+
from __future__ import annotations
|
|
14
|
+
|
|
13
15
|
from gettext import gettext as tr
|
|
16
|
+
from typing import TYPE_CHECKING
|
|
14
17
|
|
|
15
18
|
from holidays.calendars import (
|
|
16
19
|
_CustomBuddhistHolidays,
|
|
@@ -51,6 +54,9 @@ from holidays.observed_holiday_base import (
|
|
|
51
54
|
SUN_TO_NEXT_WORKDAY,
|
|
52
55
|
)
|
|
53
56
|
|
|
57
|
+
if TYPE_CHECKING:
|
|
58
|
+
from datetime import date
|
|
59
|
+
|
|
54
60
|
|
|
55
61
|
class Malaysia(
|
|
56
62
|
ObservedHolidayBase,
|
|
@@ -163,6 +169,14 @@ class Malaysia(
|
|
|
163
169
|
kwargs.setdefault("observed_rule", SUN_TO_NEXT_WORKDAY)
|
|
164
170
|
super().__init__(*args, **kwargs)
|
|
165
171
|
|
|
172
|
+
def _get_weekend(self, dt: date) -> set[int]:
|
|
173
|
+
if (
|
|
174
|
+
self.subdiv == "01" and (dt.year <= 1994 or 2014 <= dt.year <= 2024)
|
|
175
|
+
) or self.subdiv in {"02", "03", "11"}:
|
|
176
|
+
return {FRI, SAT}
|
|
177
|
+
else:
|
|
178
|
+
return {SAT, SUN}
|
|
179
|
+
|
|
166
180
|
def _populate_public_holidays(self):
|
|
167
181
|
self.dts_observed = set()
|
|
168
182
|
|
|
@@ -229,13 +243,10 @@ class Malaysia(
|
|
|
229
243
|
self.subdiv == "01" and (self._year <= 1994 or 2014 <= self._year <= 2024)
|
|
230
244
|
) or self.subdiv == "02":
|
|
231
245
|
self._observed_rule = FRI_TO_NEXT_WORKDAY
|
|
232
|
-
self.weekend = {FRI, SAT}
|
|
233
246
|
elif self.subdiv in {"03", "11"}:
|
|
234
247
|
self._observed_rule = SAT_TO_NEXT_WORKDAY
|
|
235
|
-
self.weekend = {FRI, SAT}
|
|
236
248
|
else:
|
|
237
249
|
self._observed_rule = SUN_TO_NEXT_WORKDAY
|
|
238
|
-
self.weekend = {SAT, SUN}
|
|
239
250
|
|
|
240
251
|
if self.observed:
|
|
241
252
|
self._populate_observed(self.dts_observed)
|