holidays 0.47__py3-none-any.whl → 0.49__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/__init__.py +1 -1
- holidays/calendars/gregorian.py +31 -7
- holidays/calendars/persian.py +3 -2
- holidays/calendars/thai.py +24 -20
- holidays/countries/__init__.py +1 -0
- holidays/countries/angola.py +2 -2
- holidays/countries/aruba.py +2 -3
- holidays/countries/australia.py +1 -3
- holidays/countries/belgium.py +1 -2
- holidays/countries/bolivia.py +1 -2
- holidays/countries/brazil.py +1 -2
- holidays/countries/cambodia.py +7 -8
- holidays/countries/canada.py +2 -1
- holidays/countries/chile.py +6 -6
- holidays/countries/colombia.py +1 -2
- holidays/countries/curacao.py +3 -4
- holidays/countries/cyprus.py +1 -2
- holidays/countries/denmark.py +1 -2
- holidays/countries/finland.py +3 -3
- holidays/countries/france.py +1 -2
- holidays/countries/greece.py +11 -6
- holidays/countries/hongkong.py +398 -133
- holidays/countries/israel.py +13 -13
- holidays/countries/italy.py +2 -4
- holidays/countries/japan.py +17 -6
- holidays/countries/jersey.py +2 -2
- holidays/countries/laos.py +7 -23
- holidays/countries/madagascar.py +2 -3
- holidays/countries/malaysia.py +545 -235
- holidays/countries/moldova.py +1 -2
- holidays/countries/netherlands.py +2 -3
- holidays/countries/new_zealand.py +10 -11
- holidays/countries/palau.py +127 -0
- holidays/countries/portugal.py +2 -6
- holidays/countries/saudi_arabia.py +2 -3
- holidays/countries/south_korea.py +18 -5
- holidays/countries/sweden.py +2 -3
- holidays/countries/switzerland.py +2 -3
- holidays/countries/timor_leste.py +23 -1
- holidays/countries/united_states.py +1 -1
- holidays/countries/uruguay.py +3 -4
- holidays/financial/__init__.py +1 -0
- holidays/financial/ice_futures_europe.py +47 -0
- holidays/financial/ny_stock_exchange.py +17 -4
- holidays/groups/chinese.py +2 -3
- holidays/groups/christian.py +18 -19
- holidays/groups/international.py +10 -0
- holidays/groups/islamic.py +2 -2
- holidays/groups/persian.py +2 -2
- holidays/helpers.py +9 -3
- holidays/holiday_base.py +133 -66
- holidays/locale/en_US/LC_MESSAGES/MY.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MY.po +250 -0
- holidays/locale/ms_MY/LC_MESSAGES/MY.mo +0 -0
- holidays/locale/ms_MY/LC_MESSAGES/MY.po +250 -0
- holidays/mixins.py +31 -0
- holidays/observed_holiday_base.py +25 -13
- holidays/registry.py +2 -0
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/METADATA +29 -21
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/RECORD +64 -57
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/AUTHORS +0 -0
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/LICENSE +0 -0
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/WHEEL +0 -0
- {holidays-0.47.dist-info → holidays-0.49.dist-info}/top_level.txt +0 -0
holidays/__init__.py
CHANGED
holidays/calendars/gregorian.py
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
|
|
16
15
|
GREGORIAN_CALENDAR = "GREGORIAN_CALENDAR"
|
|
17
16
|
|
|
@@ -20,6 +19,28 @@ WEEKEND = (SAT, SUN)
|
|
|
20
19
|
|
|
21
20
|
JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC = range(1, 13)
|
|
22
21
|
|
|
22
|
+
DAYS = set(str(d) for d in range(1, 32))
|
|
23
|
+
MONTHS = {
|
|
24
|
+
m: i
|
|
25
|
+
for i, m in enumerate(
|
|
26
|
+
("jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"), 1
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
WEEKDAYS = {w: i for i, w in enumerate(("mon", "tue", "wed", "thu", "fri", "sat", "sun"))}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Holiday names.
|
|
33
|
+
CHRISTMAS = "christmas"
|
|
34
|
+
WINTER_SOLSTICE = "winter_solstice"
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _timedelta(dt: date, days: int = 0) -> date:
|
|
38
|
+
"""
|
|
39
|
+
Return date that is `days` days after (days > 0) or before (days < 0) specified date.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
return date.fromordinal(dt.toordinal() + days)
|
|
43
|
+
|
|
23
44
|
|
|
24
45
|
def _get_nth_weekday_from(n: int, weekday: int, from_dt: date) -> date:
|
|
25
46
|
"""
|
|
@@ -30,10 +51,13 @@ def _get_nth_weekday_from(n: int, weekday: int, from_dt: date) -> date:
|
|
|
30
51
|
Examples: 1st Monday, 2nd Saturday, etc).
|
|
31
52
|
"""
|
|
32
53
|
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
return _timedelta(
|
|
55
|
+
from_dt,
|
|
56
|
+
(
|
|
57
|
+
(n - 1) * 7 + (weekday - from_dt.weekday()) % 7
|
|
58
|
+
if n > 0
|
|
59
|
+
else (n + 1) * 7 - (from_dt.weekday() - weekday) % 7
|
|
60
|
+
),
|
|
37
61
|
)
|
|
38
62
|
|
|
39
63
|
|
|
@@ -52,7 +76,7 @@ def _get_nth_weekday_of_month(n: int, weekday: int, month: int, year: int) -> da
|
|
|
52
76
|
if month > 12:
|
|
53
77
|
month = 1
|
|
54
78
|
year += 1
|
|
55
|
-
start_date = date(year, month, 1)
|
|
79
|
+
start_date = _timedelta(date(year, month, 1), -1)
|
|
56
80
|
else:
|
|
57
81
|
start_date = date(year, month, 1)
|
|
58
82
|
|
|
@@ -68,4 +92,4 @@ def _get_nth_weekday_of_month(n: int, weekday: int, month: int, year: int) -> da
|
|
|
68
92
|
def _get_all_sundays(year):
|
|
69
93
|
first_sunday = _get_nth_weekday_of_month(1, SUN, JAN, year)
|
|
70
94
|
for n in range(0, (date(year, DEC, 31) - first_sunday).days + 1, 7):
|
|
71
|
-
yield first_sunday
|
|
95
|
+
yield _timedelta(first_sunday, n)
|
holidays/calendars/persian.py
CHANGED
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
from typing import Optional
|
|
16
15
|
|
|
16
|
+
from holidays.calendars.gregorian import _timedelta
|
|
17
|
+
|
|
17
18
|
|
|
18
19
|
class _Persian:
|
|
19
20
|
"""
|
|
@@ -54,4 +55,4 @@ class _Persian:
|
|
|
54
55
|
|
|
55
56
|
m = j_month - 1
|
|
56
57
|
delta = (31 * m if m < 6 else 186 + 30 * (m - 6)) + j_day - 1
|
|
57
|
-
return start_date
|
|
58
|
+
return _timedelta(start_date, delta)
|
holidays/calendars/thai.py
CHANGED
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
from functools import lru_cache
|
|
16
15
|
from typing import Optional
|
|
17
16
|
|
|
17
|
+
from holidays.calendars.gregorian import _timedelta
|
|
18
|
+
|
|
18
19
|
KHMER_CALENDAR = "KHMER_CALENDAR"
|
|
19
20
|
THAI_CALENDAR = "THAI_CALENDAR"
|
|
20
21
|
|
|
@@ -230,7 +231,7 @@ class _ThaiLunisolar:
|
|
|
230
231
|
elif iter_year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN:
|
|
231
232
|
delta_days += 1
|
|
232
233
|
|
|
233
|
-
return _ThaiLunisolar.START_DATE
|
|
234
|
+
return _timedelta(_ThaiLunisolar.START_DATE, delta_days)
|
|
234
235
|
|
|
235
236
|
def makha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
|
|
236
237
|
"""
|
|
@@ -267,13 +268,14 @@ class _ThaiLunisolar:
|
|
|
267
268
|
if not start_date:
|
|
268
269
|
return None
|
|
269
270
|
|
|
270
|
-
return
|
|
271
|
-
|
|
271
|
+
return _timedelta(
|
|
272
|
+
start_date,
|
|
273
|
+
+102
|
|
272
274
|
if (
|
|
273
275
|
year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN
|
|
274
276
|
and not self.__is_khmer_calendar(calendar)
|
|
275
277
|
)
|
|
276
|
-
else +73
|
|
278
|
+
else +73,
|
|
277
279
|
)
|
|
278
280
|
|
|
279
281
|
def visakha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
|
|
@@ -310,13 +312,14 @@ class _ThaiLunisolar:
|
|
|
310
312
|
if not start_date:
|
|
311
313
|
return None
|
|
312
314
|
|
|
313
|
-
return
|
|
314
|
-
|
|
315
|
+
return _timedelta(
|
|
316
|
+
start_date,
|
|
317
|
+
+191
|
|
315
318
|
if (
|
|
316
319
|
year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN
|
|
317
320
|
and not self.__is_khmer_calendar(calendar)
|
|
318
321
|
)
|
|
319
|
-
else +161
|
|
322
|
+
else +161,
|
|
320
323
|
)
|
|
321
324
|
|
|
322
325
|
def preah_neangkoal_date(self, year: int) -> Optional[date]:
|
|
@@ -346,7 +349,7 @@ class _ThaiLunisolar:
|
|
|
346
349
|
if not start_date:
|
|
347
350
|
return None
|
|
348
351
|
|
|
349
|
-
return start_date +
|
|
352
|
+
return _timedelta(start_date, +165)
|
|
350
353
|
|
|
351
354
|
def atthami_bucha_date(self, year: int, calendar=None) -> Optional[date]:
|
|
352
355
|
"""
|
|
@@ -383,13 +386,14 @@ class _ThaiLunisolar:
|
|
|
383
386
|
if not start_date:
|
|
384
387
|
return None
|
|
385
388
|
|
|
386
|
-
return
|
|
387
|
-
|
|
389
|
+
return _timedelta(
|
|
390
|
+
start_date,
|
|
391
|
+
+199
|
|
388
392
|
if (
|
|
389
393
|
year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN
|
|
390
394
|
and not self.__is_khmer_calendar(calendar)
|
|
391
395
|
)
|
|
392
|
-
else +169
|
|
396
|
+
else +169,
|
|
393
397
|
)
|
|
394
398
|
|
|
395
399
|
def asarnha_bucha_date(self, year: int) -> Optional[date]:
|
|
@@ -430,7 +434,7 @@ class _ThaiLunisolar:
|
|
|
430
434
|
delta_days = +221
|
|
431
435
|
else:
|
|
432
436
|
delta_days = +220
|
|
433
|
-
return start_date
|
|
437
|
+
return _timedelta(start_date, delta_days)
|
|
434
438
|
|
|
435
439
|
def khao_phansa_date(self, year: int) -> Optional[date]:
|
|
436
440
|
"""
|
|
@@ -469,7 +473,7 @@ class _ThaiLunisolar:
|
|
|
469
473
|
delta_days = +222
|
|
470
474
|
else:
|
|
471
475
|
delta_days = +221
|
|
472
|
-
return start_date
|
|
476
|
+
return _timedelta(start_date, delta_days)
|
|
473
477
|
|
|
474
478
|
def boun_haw_khao_padapdin_date(self, year: int) -> Optional[date]:
|
|
475
479
|
"""
|
|
@@ -503,7 +507,7 @@ class _ThaiLunisolar:
|
|
|
503
507
|
delta_days = +265
|
|
504
508
|
else:
|
|
505
509
|
delta_days = +264
|
|
506
|
-
return start_date
|
|
510
|
+
return _timedelta(start_date, delta_days)
|
|
507
511
|
|
|
508
512
|
def boun_haw_khao_salark_date(self, year: int) -> Optional[date]:
|
|
509
513
|
"""
|
|
@@ -537,7 +541,7 @@ class _ThaiLunisolar:
|
|
|
537
541
|
delta_days = +280
|
|
538
542
|
else:
|
|
539
543
|
delta_days = +279
|
|
540
|
-
return start_date
|
|
544
|
+
return _timedelta(start_date, delta_days)
|
|
541
545
|
|
|
542
546
|
def pchum_ben_date(self, year: int) -> Optional[date]:
|
|
543
547
|
"""
|
|
@@ -571,7 +575,7 @@ class _ThaiLunisolar:
|
|
|
571
575
|
delta_days = +295
|
|
572
576
|
else:
|
|
573
577
|
delta_days = +294
|
|
574
|
-
return start_date
|
|
578
|
+
return _timedelta(start_date, delta_days)
|
|
575
579
|
|
|
576
580
|
def ok_phansa_date(self, year: int) -> Optional[date]:
|
|
577
581
|
"""
|
|
@@ -605,7 +609,7 @@ class _ThaiLunisolar:
|
|
|
605
609
|
delta_days = +310
|
|
606
610
|
else:
|
|
607
611
|
delta_days = +309
|
|
608
|
-
return start_date
|
|
612
|
+
return _timedelta(start_date, delta_days)
|
|
609
613
|
|
|
610
614
|
def boun_suang_heua_date(self, year: int) -> Optional[date]:
|
|
611
615
|
"""
|
|
@@ -639,7 +643,7 @@ class _ThaiLunisolar:
|
|
|
639
643
|
delta_days = +311
|
|
640
644
|
else:
|
|
641
645
|
delta_days = +310
|
|
642
|
-
return start_date
|
|
646
|
+
return _timedelta(start_date, delta_days)
|
|
643
647
|
|
|
644
648
|
def loy_krathong_date(self, year: int) -> Optional[date]:
|
|
645
649
|
"""
|
|
@@ -673,4 +677,4 @@ class _ThaiLunisolar:
|
|
|
673
677
|
delta_days = +339
|
|
674
678
|
else:
|
|
675
679
|
delta_days = +338
|
|
676
|
-
return start_date
|
|
680
|
+
return _timedelta(start_date, delta_days)
|
holidays/countries/__init__.py
CHANGED
|
@@ -115,6 +115,7 @@ from .north_macedonia import NorthMacedonia, MK, MKD
|
|
|
115
115
|
from .northern_mariana_islands import NorthernMarianaIslands, MP, MNP, HolidaysMP
|
|
116
116
|
from .norway import Norway, NO, NOR
|
|
117
117
|
from .pakistan import Pakistan, PK, PAK
|
|
118
|
+
from .palau import Palau, PW, PLW
|
|
118
119
|
from .panama import Panama, PA, PAN
|
|
119
120
|
from .papua_new_guinea import PapuaNewGuinea, PG, PNG
|
|
120
121
|
from .paraguay import Paraguay, PY, PRY
|
holidays/countries/angola.py
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
14
|
from gettext import gettext as tr
|
|
15
|
-
from typing import Tuple
|
|
15
|
+
from typing import Optional, Tuple
|
|
16
16
|
|
|
17
17
|
from holidays.calendars.gregorian import AUG, SEP
|
|
18
18
|
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
|
|
@@ -59,7 +59,7 @@ class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
|
|
|
59
59
|
# it rolls over to the following Monday.
|
|
60
60
|
return dt >= date(1996, SEP, 27)
|
|
61
61
|
|
|
62
|
-
def _add_observed(self, dt: date, **kwargs) -> Tuple[bool, date]:
|
|
62
|
+
def _add_observed(self, dt: date, **kwargs) -> Tuple[bool, Optional[date]]:
|
|
63
63
|
# As per Law # #11/18, from 2018/9/10, when public holiday falls on Tuesday or Thursday,
|
|
64
64
|
# the Monday or Friday is also a holiday.
|
|
65
65
|
kwargs.setdefault(
|
holidays/countries/aruba.py
CHANGED
|
@@ -11,10 +11,9 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
from gettext import gettext as tr
|
|
16
15
|
|
|
17
|
-
from holidays.calendars.gregorian import APR, AUG
|
|
16
|
+
from holidays.calendars.gregorian import APR, AUG, _timedelta
|
|
18
17
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
19
18
|
from holidays.holiday_base import HolidayBase
|
|
20
19
|
|
|
@@ -118,7 +117,7 @@ class Aruba(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
118
117
|
else:
|
|
119
118
|
dt = (AUG, 31)
|
|
120
119
|
if self._is_sunday(dt):
|
|
121
|
-
dt = date(self._year, *dt)
|
|
120
|
+
dt = _timedelta(date(self._year, *dt), -1 if self._year >= 1980 else +1)
|
|
122
121
|
self._add_holiday(name, dt)
|
|
123
122
|
|
|
124
123
|
# Dia di Labor/Dia di Obrero.
|
holidays/countries/australia.py
CHANGED
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
|
-
|
|
15
13
|
from holidays.calendars.gregorian import JAN, APR, JUN, AUG, SEP, OCT, DEC
|
|
16
14
|
from holidays.constants import BANK, HALF_DAY, PUBLIC
|
|
17
15
|
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
|
|
@@ -698,7 +696,7 @@ class Australia(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, S
|
|
|
698
696
|
|
|
699
697
|
# Easter Tuesday.
|
|
700
698
|
if self._year <= 2010:
|
|
701
|
-
self.
|
|
699
|
+
self._add_holiday_2_days_past_easter("Easter Tuesday")
|
|
702
700
|
|
|
703
701
|
# ANZAC Day.
|
|
704
702
|
if self._year >= 1921:
|
holidays/countries/belgium.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
15
|
from holidays.constants import BANK, PUBLIC
|
|
@@ -78,7 +77,7 @@ class Belgium(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
78
77
|
self._add_good_friday(tr("Goede Vrijdag"))
|
|
79
78
|
|
|
80
79
|
# Friday after Ascension Day.
|
|
81
|
-
self.
|
|
80
|
+
self._add_holiday_40_days_past_easter(tr("Vrijdag na O. L. H. Hemelvaart"))
|
|
82
81
|
|
|
83
82
|
# Bank Holiday.
|
|
84
83
|
self._add_christmas_day_two(tr("Banksluitingsdag"))
|
holidays/countries/bolivia.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
15
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
@@ -147,7 +146,7 @@ class Bolivia(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
147
146
|
|
|
148
147
|
def _populate_subdiv_o_public_holidays(self):
|
|
149
148
|
# Carnival in Oruro.
|
|
150
|
-
self.
|
|
149
|
+
self._add_holiday_51_days_prior_easter(tr("Carnaval de Oruro"))
|
|
151
150
|
|
|
152
151
|
def _populate_subdiv_s_public_holidays(self):
|
|
153
152
|
# Santa Cruz Day.
|
holidays/countries/brazil.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from datetime import date
|
|
15
14
|
|
|
16
15
|
from holidays.calendars.gregorian import JAN, MAR, SEP, NOV, FRI, _get_nth_weekday_from
|
|
@@ -231,7 +230,7 @@ class Brazil(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
231
230
|
def _populate_subdiv_es_public_holidays(self):
|
|
232
231
|
if self._year >= 2020:
|
|
233
232
|
# Our Lady of Penha.
|
|
234
|
-
self.
|
|
233
|
+
self._add_holiday_8_days_past_easter("Nossa Senhora da Penha")
|
|
235
234
|
|
|
236
235
|
def _populate_subdiv_go_public_holidays(self):
|
|
237
236
|
# Foundation of Goiás city.
|
holidays/countries/cambodia.py
CHANGED
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
|
-
from holidays.calendars.gregorian import MAY, AUG, SEP
|
|
15
|
+
from holidays.calendars.gregorian import MAY, AUG, SEP, _timedelta
|
|
17
16
|
from holidays.calendars.thai import KHMER_CALENDAR
|
|
18
17
|
from holidays.groups import InternationalHolidays, StaticHolidays, ThaiCalendarHolidays
|
|
19
18
|
from holidays.holiday_base import HolidayBase
|
|
@@ -98,8 +97,8 @@ class Cambodia(HolidayBase, InternationalHolidays, StaticHolidays, ThaiCalendarH
|
|
|
98
97
|
if self._year in sangkranta_years_apr_14
|
|
99
98
|
else self._add_holiday_apr_13(sangkranta)
|
|
100
99
|
)
|
|
101
|
-
self._add_holiday(sangkranta, dt +
|
|
102
|
-
self._add_holiday(sangkranta, dt +
|
|
100
|
+
self._add_holiday(sangkranta, _timedelta(dt, +1))
|
|
101
|
+
self._add_holiday(sangkranta, _timedelta(dt, +2))
|
|
103
102
|
|
|
104
103
|
# ទិវាពលកម្មអន្តរជាតិ
|
|
105
104
|
# Status: In-Use.
|
|
@@ -253,9 +252,9 @@ class Cambodia(HolidayBase, InternationalHolidays, StaticHolidays, ThaiCalendarH
|
|
|
253
252
|
pchum_ben = tr("ពិធីបុណ្យភ្ផុំបិណ្ឌ")
|
|
254
253
|
pchum_ben_date = self._add_pchum_ben(pchum_ben)
|
|
255
254
|
if pchum_ben_date:
|
|
256
|
-
self._add_holiday(pchum_ben, pchum_ben_date
|
|
255
|
+
self._add_holiday(pchum_ben, _timedelta(pchum_ben_date, -1))
|
|
257
256
|
if self._year >= 2017:
|
|
258
|
-
self._add_holiday(pchum_ben, pchum_ben_date +
|
|
257
|
+
self._add_holiday(pchum_ben, _timedelta(pchum_ben_date, +1))
|
|
259
258
|
|
|
260
259
|
# ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក
|
|
261
260
|
# Status: In-Use.
|
|
@@ -265,8 +264,8 @@ class Cambodia(HolidayBase, InternationalHolidays, StaticHolidays, ThaiCalendarH
|
|
|
265
264
|
bon_om_touk = tr("ព្រះរាជពិធីបុណ្យអុំទូក បណ្តែតប្រទីប និងសំពះព្រះខែអកអំបុក")
|
|
266
265
|
bon_om_touk_date = self._add_loy_krathong(bon_om_touk)
|
|
267
266
|
if bon_om_touk_date:
|
|
268
|
-
self._add_holiday(bon_om_touk, bon_om_touk_date
|
|
269
|
-
self._add_holiday(bon_om_touk, bon_om_touk_date +
|
|
267
|
+
self._add_holiday(bon_om_touk, _timedelta(bon_om_touk_date, -1))
|
|
268
|
+
self._add_holiday(bon_om_touk, _timedelta(bon_om_touk_date, +1))
|
|
270
269
|
|
|
271
270
|
|
|
272
271
|
class KH(Cambodia):
|
holidays/countries/canada.py
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
14
|
from gettext import gettext as tr
|
|
15
|
+
from typing import Optional
|
|
15
16
|
|
|
16
17
|
from holidays.calendars.gregorian import MAR, APR, JUN, JUL, SEP
|
|
17
18
|
from holidays.constants import GOVERNMENT, OPTIONAL, PUBLIC
|
|
@@ -69,7 +70,7 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
|
|
|
69
70
|
kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
|
|
70
71
|
super().__init__(*args, **kwargs)
|
|
71
72
|
|
|
72
|
-
def _get_nearest_monday(self, *args) -> date:
|
|
73
|
+
def _get_nearest_monday(self, *args) -> Optional[date]:
|
|
73
74
|
return self._get_observed_date(date(self._year, *args), rule=ALL_TO_NEAREST_MON)
|
|
74
75
|
|
|
75
76
|
def _add_statutory_holidays(self):
|
holidays/countries/chile.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
from typing import Tuple
|
|
16
15
|
|
|
@@ -100,11 +99,12 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
|
|
|
100
99
|
self._add_ascension_thursday(tr("Ascensión del Señor"))
|
|
101
100
|
|
|
102
101
|
if self._year <= 1967 or 1987 <= self._year <= 2006:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
self.
|
|
107
|
-
|
|
102
|
+
# Corpus Christi.
|
|
103
|
+
name = tr("Corpus Christi")
|
|
104
|
+
if self._year <= 1999:
|
|
105
|
+
self._add_corpus_christi_day(name)
|
|
106
|
+
else:
|
|
107
|
+
self._add_holiday_57_days_past_easter(name)
|
|
108
108
|
|
|
109
109
|
if self._year >= 1932:
|
|
110
110
|
# Labor Day.
|
holidays/countries/colombia.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
15
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
@@ -81,7 +80,7 @@ class Colombia(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
81
80
|
if self._year >= 1984:
|
|
82
81
|
self._move_holiday(
|
|
83
82
|
# Sacred Heart.
|
|
84
|
-
self.
|
|
83
|
+
self._add_holiday_68_days_past_easter(tr("Sagrado Corazón"))
|
|
85
84
|
)
|
|
86
85
|
|
|
87
86
|
if self._year >= 1951:
|
holidays/countries/curacao.py
CHANGED
|
@@ -11,10 +11,9 @@
|
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
13
|
from datetime import date
|
|
14
|
-
from datetime import timedelta as td
|
|
15
14
|
from gettext import gettext as tr
|
|
16
15
|
|
|
17
|
-
from holidays.calendars.gregorian import APR, MAY
|
|
16
|
+
from holidays.calendars.gregorian import APR, MAY, _timedelta
|
|
18
17
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
19
18
|
from holidays.holiday_base import HolidayBase
|
|
20
19
|
|
|
@@ -90,7 +89,7 @@ class Curacao(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
90
89
|
)
|
|
91
90
|
dt = date(self._year, APR, 27 if self._year >= 2014 else 30)
|
|
92
91
|
if self._is_sunday(dt):
|
|
93
|
-
dt
|
|
92
|
+
dt = _timedelta(dt, -1 if self._year >= 1980 else +1)
|
|
94
93
|
self._add_holiday(name, dt)
|
|
95
94
|
|
|
96
95
|
# Dia di Obrero.
|
|
@@ -99,7 +98,7 @@ class Curacao(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
99
98
|
|
|
100
99
|
dt = date(self._year, MAY, 1)
|
|
101
100
|
if self._is_sunday(dt) or (self._is_monday(dt) and self._year <= 1979):
|
|
102
|
-
dt
|
|
101
|
+
dt = _timedelta(dt, +1)
|
|
103
102
|
# Labor Day
|
|
104
103
|
self._add_holiday(tr("Dia di Obrero"), dt)
|
|
105
104
|
|
holidays/countries/cyprus.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
15
|
from holidays.calendars.julian_revised import JULIAN_REVISED_CALENDAR
|
|
@@ -93,7 +92,7 @@ class Cyprus(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
93
92
|
return None
|
|
94
93
|
|
|
95
94
|
# Easter Tuesday.
|
|
96
|
-
self.
|
|
95
|
+
self._add_holiday_2_days_past_easter(tr("Τρίτη της Διακαινησίμου"))
|
|
97
96
|
|
|
98
97
|
def _populate_optional_holidays(self):
|
|
99
98
|
if self._year <= 1960:
|
holidays/countries/denmark.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
15
|
from holidays.constants import OPTIONAL, PUBLIC
|
|
@@ -56,7 +55,7 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
56
55
|
|
|
57
56
|
if self._year <= 2023:
|
|
58
57
|
# Great Day of Prayers.
|
|
59
|
-
self.
|
|
58
|
+
self._add_holiday_26_days_past_easter(tr("Store bededag"))
|
|
60
59
|
|
|
61
60
|
# Ascension Day.
|
|
62
61
|
self._add_ascension_thursday(tr("Kristi himmelfartsdag"))
|
holidays/countries/finland.py
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
15
|
+
from holidays.calendars.gregorian import _timedelta
|
|
16
16
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
17
17
|
from holidays.holiday_base import HolidayBase
|
|
18
18
|
|
|
@@ -57,7 +57,7 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
57
57
|
# Ascension Day.
|
|
58
58
|
name = tr("Helatorstai")
|
|
59
59
|
if 1973 <= self._year <= 1990:
|
|
60
|
-
self.
|
|
60
|
+
self._add_holiday_34_days_past_easter(name)
|
|
61
61
|
else:
|
|
62
62
|
self._add_ascension_thursday(name)
|
|
63
63
|
|
|
@@ -72,7 +72,7 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
72
72
|
dt = self._add_holiday_jun_23(name)
|
|
73
73
|
|
|
74
74
|
# Midsummer Day.
|
|
75
|
-
self._add_holiday(tr("Juhannuspäivä"), dt +
|
|
75
|
+
self._add_holiday(tr("Juhannuspäivä"), _timedelta(dt, +1))
|
|
76
76
|
|
|
77
77
|
# All Saints' Day.
|
|
78
78
|
name = tr("Pyhäinpäivä")
|
holidays/countries/france.py
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
# Website: https://github.com/vacanza/python-holidays
|
|
11
11
|
# License: MIT (see LICENSE file)
|
|
12
12
|
|
|
13
|
-
from datetime import timedelta as td
|
|
14
13
|
from gettext import gettext as tr
|
|
15
14
|
|
|
16
15
|
from holidays.groups import ChristianHolidays, InternationalHolidays
|
|
@@ -158,7 +157,7 @@ class France(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
158
157
|
self._add_good_friday(tr("Vendredi saint"))
|
|
159
158
|
|
|
160
159
|
# Mi-Careme.
|
|
161
|
-
self.
|
|
160
|
+
self._add_holiday_24_days_prior_easter(tr("Mi-Carême"))
|
|
162
161
|
|
|
163
162
|
# Abolition of slavery.
|
|
164
163
|
self._add_holiday_may_27(tr("Abolition de l'esclavage"))
|
holidays/countries/greece.py
CHANGED
|
@@ -27,7 +27,8 @@ class Greece(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
27
27
|
Greece holidays.
|
|
28
28
|
|
|
29
29
|
References:
|
|
30
|
-
|
|
30
|
+
- https://en.wikipedia.org/wiki/Public_holidays_in_Greece
|
|
31
|
+
- `2024 Labor Day transfer <https://www.et.gr/api/DownloadFeksApi/?fek_pdf=20240201406>`_
|
|
31
32
|
"""
|
|
32
33
|
|
|
33
34
|
country = "GR"
|
|
@@ -66,11 +67,15 @@ class Greece(ObservedHolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
66
67
|
# Whit Monday.
|
|
67
68
|
self._add_whit_monday(tr("Δευτέρα του Αγίου Πνεύματος"))
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
# Labor Day.
|
|
71
|
+
name = tr("Εργατική Πρωτομαγιά")
|
|
72
|
+
if self._year == 2024:
|
|
73
|
+
self._add_holiday_may_7(name)
|
|
74
|
+
else:
|
|
75
|
+
self._add_observed(
|
|
76
|
+
may_1 := self._add_labor_day(name),
|
|
77
|
+
rule=MON_TO_NEXT_TUE if may_1 == easter_monday else SAT_SUN_TO_NEXT_WORKDAY,
|
|
78
|
+
)
|
|
74
79
|
|
|
75
80
|
# Dormition of the Mother of God.
|
|
76
81
|
self._add_assumption_of_mary_day(tr("Κοίμηση της Θεοτόκου"))
|