holidays 0.82__py3-none-any.whl → 0.84__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.
Files changed (113) hide show
  1. holidays/calendars/balinese_saka.py +2 -3
  2. holidays/calendars/buddhist.py +3 -4
  3. holidays/calendars/burmese.py +9 -10
  4. holidays/calendars/chinese.py +8 -9
  5. holidays/calendars/hebrew.py +10 -11
  6. holidays/calendars/hindu.py +27 -28
  7. holidays/calendars/islamic.py +26 -6
  8. holidays/calendars/mandaean.py +2 -3
  9. holidays/calendars/mongolian.py +4 -5
  10. holidays/calendars/persian.py +2 -3
  11. holidays/calendars/sinhala.py +25 -14
  12. holidays/calendars/thai.py +13 -14
  13. holidays/calendars/tibetan.py +12 -13
  14. holidays/countries/__init__.py +1 -0
  15. holidays/countries/angola.py +1 -2
  16. holidays/countries/austria.py +1 -1
  17. holidays/countries/azerbaijan.py +1 -1
  18. holidays/countries/canada.py +27 -13
  19. holidays/countries/denmark.py +18 -6
  20. holidays/countries/fiji.py +2 -3
  21. holidays/countries/finland.py +3 -6
  22. holidays/countries/guernsey.py +1 -2
  23. holidays/countries/guyana.py +24 -32
  24. holidays/countries/india.py +21 -78
  25. holidays/countries/iran.py +133 -269
  26. holidays/countries/ireland.py +1 -1
  27. holidays/countries/israel.py +1 -1
  28. holidays/countries/italy.py +2 -2
  29. holidays/countries/jersey.py +1 -2
  30. holidays/countries/macau.py +5 -8
  31. holidays/countries/malta.py +1 -1
  32. holidays/countries/mauritius.py +10 -9
  33. holidays/countries/montserrat.py +1 -1
  34. holidays/countries/myanmar.py +9 -10
  35. holidays/countries/nepal.py +11 -30
  36. holidays/countries/netherlands.py +28 -24
  37. holidays/countries/new_zealand.py +75 -31
  38. holidays/countries/nigeria.py +53 -75
  39. holidays/countries/norway.py +1 -1
  40. holidays/countries/portugal.py +6 -3
  41. holidays/countries/rwanda.py +2 -2
  42. holidays/countries/sint_maarten.py +1 -1
  43. holidays/countries/slovakia.py +23 -4
  44. holidays/countries/spain.py +418 -214
  45. holidays/countries/sri_lanka.py +58 -91
  46. holidays/countries/suriname.py +1 -2
  47. holidays/countries/sweden.py +1 -1
  48. holidays/countries/switzerland.py +86 -3
  49. holidays/countries/taiwan.py +3 -3
  50. holidays/countries/tanzania.py +19 -29
  51. holidays/countries/thailand.py +8 -7
  52. holidays/countries/trinidad_and_tobago.py +1 -1
  53. holidays/countries/ukraine.py +1 -1
  54. holidays/countries/united_kingdom.py +2 -3
  55. holidays/countries/united_states.py +3 -4
  56. holidays/countries/western_sahara.py +92 -0
  57. holidays/groups/balinese_saka.py +2 -3
  58. holidays/groups/buddhist.py +6 -7
  59. holidays/groups/burmese.py +11 -12
  60. holidays/groups/chinese.py +23 -21
  61. holidays/groups/christian.py +30 -0
  62. holidays/groups/eastern.py +5 -4
  63. holidays/groups/hebrew.py +7 -10
  64. holidays/groups/hindu.py +45 -40
  65. holidays/groups/international.py +1 -1
  66. holidays/groups/islamic.py +10 -3
  67. holidays/groups/mandaean.py +13 -14
  68. holidays/groups/mongolian.py +12 -10
  69. holidays/groups/persian.py +14 -15
  70. holidays/groups/sinhala.py +19 -17
  71. holidays/groups/thai.py +12 -13
  72. holidays/groups/tibetan.py +21 -19
  73. holidays/holiday_base.py +54 -54
  74. holidays/ical.py +1 -2
  75. holidays/locale/ar/LC_MESSAGES/EH.mo +0 -0
  76. holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
  77. holidays/locale/de/LC_MESSAGES/CH.mo +0 -0
  78. holidays/locale/en_US/LC_MESSAGES/CH.mo +0 -0
  79. holidays/locale/en_US/LC_MESSAGES/EH.mo +0 -0
  80. holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
  81. holidays/locale/en_US/LC_MESSAGES/LK.mo +0 -0
  82. holidays/locale/en_US/LC_MESSAGES/NL.mo +0 -0
  83. holidays/locale/es/LC_MESSAGES/EH.mo +0 -0
  84. holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
  85. holidays/locale/fr/LC_MESSAGES/CH.mo +0 -0
  86. holidays/locale/fr/LC_MESSAGES/EH.mo +0 -0
  87. holidays/locale/fy/LC_MESSAGES/NL.mo +0 -0
  88. holidays/locale/it/LC_MESSAGES/CH.mo +0 -0
  89. holidays/locale/nl/LC_MESSAGES/NL.mo +0 -0
  90. holidays/locale/si_LK/LC_MESSAGES/LK.mo +0 -0
  91. holidays/locale/ta_LK/LC_MESSAGES/LK.mo +0 -0
  92. holidays/locale/th/LC_MESSAGES/CH.mo +0 -0
  93. holidays/locale/th/LC_MESSAGES/CN.mo +0 -0
  94. holidays/locale/th/LC_MESSAGES/DK.mo +0 -0
  95. holidays/locale/th/LC_MESSAGES/ES.mo +0 -0
  96. holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
  97. holidays/locale/th/LC_MESSAGES/KR.mo +0 -0
  98. holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
  99. holidays/locale/th/LC_MESSAGES/NL.mo +0 -0
  100. holidays/locale/uk/LC_MESSAGES/CH.mo +0 -0
  101. holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
  102. holidays/locale/uk/LC_MESSAGES/NL.mo +0 -0
  103. holidays/mixins/child_entity.py +1 -3
  104. holidays/observed_holiday_base.py +25 -14
  105. holidays/registry.py +5 -3
  106. holidays/utils.py +13 -14
  107. holidays/version.py +1 -1
  108. {holidays-0.82.dist-info → holidays-0.84.dist-info}/METADATA +20 -19
  109. {holidays-0.82.dist-info → holidays-0.84.dist-info}/RECORD +113 -104
  110. {holidays-0.82.dist-info → holidays-0.84.dist-info}/WHEEL +0 -0
  111. {holidays-0.82.dist-info → holidays-0.84.dist-info}/licenses/CONTRIBUTORS +0 -0
  112. {holidays-0.82.dist-info → holidays-0.84.dist-info}/licenses/LICENSE +0 -0
  113. {holidays-0.82.dist-info → holidays-0.84.dist-info}/top_level.txt +0 -0
@@ -12,7 +12,6 @@
12
12
 
13
13
  from collections.abc import Iterable
14
14
  from datetime import date
15
- from typing import Optional
16
15
 
17
16
  from holidays.calendars.custom import _CustomCalendar
18
17
  from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
@@ -47,7 +46,7 @@ class _SinhalaLunar:
47
46
  """
48
47
 
49
48
  START_YEAR = 2003
50
- END_YEAR = 2025
49
+ END_YEAR = 2026
51
50
 
52
51
  BAK_POYA_DATES = {
53
52
  2003: (APR, 16),
@@ -73,6 +72,7 @@ class _SinhalaLunar:
73
72
  2023: (APR, 5),
74
73
  2024: (APR, 23),
75
74
  2025: (APR, 12),
75
+ 2026: (APR, 1),
76
76
  }
77
77
 
78
78
  BINARA_POYA_DATES = {
@@ -99,6 +99,7 @@ class _SinhalaLunar:
99
99
  2023: (SEP, 29),
100
100
  2024: (SEP, 17),
101
101
  2025: (SEP, 7),
102
+ 2026: (SEP, 26),
102
103
  }
103
104
 
104
105
  DURUTHU_POYA_DATES = {
@@ -124,6 +125,7 @@ class _SinhalaLunar:
124
125
  2023: (JAN, 6),
125
126
  2024: (JAN, 25),
126
127
  2025: (JAN, 13),
128
+ 2026: (JAN, 3),
127
129
  }
128
130
 
129
131
  ESALA_POYA_DATES = {
@@ -150,6 +152,7 @@ class _SinhalaLunar:
150
152
  2023: (AUG, 1),
151
153
  2024: (JUL, 20),
152
154
  2025: (JUL, 10),
155
+ 2026: (JUL, 29),
153
156
  }
154
157
 
155
158
  IL_POYA_DATES = {
@@ -176,6 +179,7 @@ class _SinhalaLunar:
176
179
  2023: (NOV, 26),
177
180
  2024: (NOV, 15),
178
181
  2025: (NOV, 5),
182
+ 2026: (NOV, 24),
179
183
  }
180
184
 
181
185
  MEDIN_POYA_DATES = {
@@ -202,6 +206,7 @@ class _SinhalaLunar:
202
206
  2023: (MAR, 6),
203
207
  2024: (MAR, 24),
204
208
  2025: (MAR, 13),
209
+ 2026: (MAR, 2),
205
210
  }
206
211
 
207
212
  NAWAM_POYA_DATES = {
@@ -228,6 +233,7 @@ class _SinhalaLunar:
228
233
  2023: (FEB, 5),
229
234
  2024: (FEB, 23),
230
235
  2025: (FEB, 12),
236
+ 2026: (FEB, 1),
231
237
  }
232
238
 
233
239
  NIKINI_POYA_DATES = {
@@ -254,6 +260,7 @@ class _SinhalaLunar:
254
260
  2023: (AUG, 30),
255
261
  2024: (AUG, 19),
256
262
  2025: (AUG, 8),
263
+ 2026: (AUG, 27),
257
264
  }
258
265
 
259
266
  POSON_POYA_DATES = {
@@ -280,6 +287,7 @@ class _SinhalaLunar:
280
287
  2023: (JUN, 3),
281
288
  2024: (JUN, 21),
282
289
  2025: (JUN, 10),
290
+ 2026: (JUN, 29),
283
291
  }
284
292
 
285
293
  UNDUVAP_POYA_DATES = {
@@ -306,6 +314,7 @@ class _SinhalaLunar:
306
314
  2023: (DEC, 26),
307
315
  2024: (DEC, 14),
308
316
  2025: (DEC, 4),
317
+ 2026: (DEC, 23),
309
318
  }
310
319
 
311
320
  VAP_POYA_DATES = {
@@ -332,6 +341,7 @@ class _SinhalaLunar:
332
341
  2023: (OCT, 28),
333
342
  2024: (OCT, 17),
334
343
  2025: (OCT, 6),
344
+ 2026: (OCT, 25),
335
345
  }
336
346
 
337
347
  VESAK_POYA_DATES = {
@@ -358,9 +368,10 @@ class _SinhalaLunar:
358
368
  2023: (MAY, 5),
359
369
  2024: (MAY, 23),
360
370
  2025: (MAY, 12),
371
+ 2026: (MAY, 1),
361
372
  }
362
373
 
363
- def _get_holiday(self, holiday: str, year: int) -> tuple[Optional[date], bool]:
374
+ def _get_holiday(self, holiday: str, year: int) -> tuple[date | None, bool]:
364
375
  estimated_dates = getattr(self, f"{holiday}_DATES", {})
365
376
  exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
366
377
  dt = exact_dates.get(year, estimated_dates.get(year, ()))
@@ -373,40 +384,40 @@ class _SinhalaLunar:
373
384
  for dt in _normalize_tuple(exact_dates.get(year, estimated_dates.get(year, ()))):
374
385
  yield date(year, *dt), year not in exact_dates
375
386
 
376
- def bak_poya_date(self, year: int) -> tuple[Optional[date], bool]:
387
+ def bak_poya_date(self, year: int) -> tuple[date | None, bool]:
377
388
  return self._get_holiday(BAK_POYA, year)
378
389
 
379
- def binara_poya_date(self, year: int) -> tuple[Optional[date], bool]:
390
+ def binara_poya_date(self, year: int) -> tuple[date | None, bool]:
380
391
  return self._get_holiday(BINARA_POYA, year)
381
392
 
382
393
  def duruthu_poya_date(self, year: int) -> Iterable[tuple[date, bool]]:
383
394
  return self._get_holiday_set(DURUTHU_POYA, year)
384
395
 
385
- def esala_poya_date(self, year: int) -> tuple[Optional[date], bool]:
396
+ def esala_poya_date(self, year: int) -> tuple[date | None, bool]:
386
397
  return self._get_holiday(ESALA_POYA, year)
387
398
 
388
- def il_poya_date(self, year: int) -> tuple[Optional[date], bool]:
399
+ def il_poya_date(self, year: int) -> tuple[date | None, bool]:
389
400
  return self._get_holiday(IL_POYA, year)
390
401
 
391
- def medin_poya_date(self, year: int) -> tuple[Optional[date], bool]:
402
+ def medin_poya_date(self, year: int) -> tuple[date | None, bool]:
392
403
  return self._get_holiday(MEDIN_POYA, year)
393
404
 
394
- def nawam_poya_date(self, year: int) -> tuple[Optional[date], bool]:
405
+ def nawam_poya_date(self, year: int) -> tuple[date | None, bool]:
395
406
  return self._get_holiday(NAWAM_POYA, year)
396
407
 
397
- def nikini_poya_date(self, year: int) -> tuple[Optional[date], bool]:
408
+ def nikini_poya_date(self, year: int) -> tuple[date | None, bool]:
398
409
  return self._get_holiday(NIKINI_POYA, year)
399
410
 
400
- def poson_poya_date(self, year: int) -> tuple[Optional[date], bool]:
411
+ def poson_poya_date(self, year: int) -> tuple[date | None, bool]:
401
412
  return self._get_holiday(POSON_POYA, year)
402
413
 
403
- def unduvap_poya_date(self, year: int) -> tuple[Optional[date], bool]:
414
+ def unduvap_poya_date(self, year: int) -> tuple[date | None, bool]:
404
415
  return self._get_holiday(UNDUVAP_POYA, year)
405
416
 
406
- def vap_poya_date(self, year: int) -> tuple[Optional[date], bool]:
417
+ def vap_poya_date(self, year: int) -> tuple[date | None, bool]:
407
418
  return self._get_holiday(VAP_POYA, year)
408
419
 
409
- def vesak_poya_date(self, year: int) -> tuple[Optional[date], bool]:
420
+ def vesak_poya_date(self, year: int) -> tuple[date | None, bool]:
410
421
  return self._get_holiday(VESAK_POYA, year)
411
422
 
412
423
 
@@ -12,7 +12,6 @@
12
12
 
13
13
  from datetime import date
14
14
  from functools import cache
15
- from typing import Optional
16
15
 
17
16
  from holidays.calendars.gregorian import _timedelta
18
17
 
@@ -296,7 +295,7 @@ class _ThaiLunisolar:
296
295
  )
297
296
 
298
297
  @cache
299
- def _get_start_date(self, year: int) -> Optional[date]:
298
+ def _get_start_date(self, year: int) -> date | None:
300
299
  """Calculate the start date of that particular Thai Lunar Calendar Year.
301
300
 
302
301
  This usually falls in November or December of the previous Gregorian
@@ -367,7 +366,7 @@ class _ThaiLunisolar:
367
366
 
368
367
  return buddhist_sabbaths
369
368
 
370
- def makha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
369
+ def makha_bucha_date(self, year: int, calendar=None) -> date | None:
371
370
  """Calculate the estimated Gregorian date of Makha Bucha.
372
371
 
373
372
  Also known as "Magha Puja", "Makha Buxha" and "Meak Bochea".
@@ -415,7 +414,7 @@ class _ThaiLunisolar:
415
414
  else +73,
416
415
  )
417
416
 
418
- def visakha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
417
+ def visakha_bucha_date(self, year: int, calendar=None) -> date | None:
419
418
  """Calculate the estimated Gregorian date of Visakha Bucha.
420
419
 
421
420
  Also known as "Vesak" and "Buddha Day". This coincides with
@@ -462,7 +461,7 @@ class _ThaiLunisolar:
462
461
  else +161,
463
462
  )
464
463
 
465
- def preah_neangkoal_date(self, year: int) -> Optional[date]:
464
+ def preah_neangkoal_date(self, year: int) -> date | None:
466
465
  """Calculate the estimated Gregorian date of Preah Neangkoal.
467
466
 
468
467
  Also known as "Cambodian Royal Ploughing Ceremony". This always
@@ -494,7 +493,7 @@ class _ThaiLunisolar:
494
493
 
495
494
  return _timedelta(start_date, +165)
496
495
 
497
- def atthami_bucha_date(self, year: int, calendar=None) -> Optional[date]:
496
+ def atthami_bucha_date(self, year: int, calendar=None) -> date | None:
498
497
  """Calculate the estimated Gregorian date of Atthami Bucha.
499
498
 
500
499
  Also known as "Buddha's Cremation Day". This coincides with
@@ -543,7 +542,7 @@ class _ThaiLunisolar:
543
542
  else +169,
544
543
  )
545
544
 
546
- def asarnha_bucha_date(self, year: int) -> Optional[date]:
545
+ def asarnha_bucha_date(self, year: int) -> date | None:
547
546
  """Calculate the estimated Gregorian date of Asarnha Bucha.
548
547
 
549
548
  Also known as "Asalha Puja". This coincides with
@@ -583,7 +582,7 @@ class _ThaiLunisolar:
583
582
  delta_days = +220
584
583
  return _timedelta(start_date, delta_days)
585
584
 
586
- def khao_phansa_date(self, year: int) -> Optional[date]:
585
+ def khao_phansa_date(self, year: int) -> date | None:
587
586
  """Calculate the estimated Gregorian date of Khao Phansa.
588
587
 
589
588
  Also known as "(Start of) Buddhist Lent" and "Start of Vassa".
@@ -623,7 +622,7 @@ class _ThaiLunisolar:
623
622
  delta_days = +221
624
623
  return _timedelta(start_date, delta_days)
625
624
 
626
- def boun_haw_khao_padapdin_date(self, year: int) -> Optional[date]:
625
+ def boun_haw_khao_padapdin_date(self, year: int) -> date | None:
627
626
  """Calculate the estimated Gregorian date of Boun Haw Khao Padapdin.
628
627
 
629
628
  Also known as "Boon Khao Padap Din".
@@ -660,7 +659,7 @@ class _ThaiLunisolar:
660
659
  delta_days = +264
661
660
  return _timedelta(start_date, delta_days)
662
661
 
663
- def boun_haw_khao_salark_date(self, year: int) -> Optional[date]:
662
+ def boun_haw_khao_salark_date(self, year: int) -> date | None:
664
663
  """Calculate the estimated Gregorian date of Boun Haw Khao Salark.
665
664
 
666
665
  Also known as "Boon Khao Sak".
@@ -697,7 +696,7 @@ class _ThaiLunisolar:
697
696
  delta_days = +279
698
697
  return _timedelta(start_date, delta_days)
699
698
 
700
- def pchum_ben_date(self, year: int) -> Optional[date]:
699
+ def pchum_ben_date(self, year: int) -> date | None:
701
700
  """Calculate the estimated Gregorian date of Pchum Ben.
702
701
 
703
702
  Also known as "Prachum Bandar".
@@ -734,7 +733,7 @@ class _ThaiLunisolar:
734
733
  delta_days = +294
735
734
  return _timedelta(start_date, delta_days)
736
735
 
737
- def ok_phansa_date(self, year: int) -> Optional[date]:
736
+ def ok_phansa_date(self, year: int) -> date | None:
738
737
  """Calculate the estimated Gregorian date of Ok Phansa.
739
738
 
740
739
  Also known as "End of Buddhist Lent" and "End of Vassa".
@@ -771,7 +770,7 @@ class _ThaiLunisolar:
771
770
  delta_days = +309
772
771
  return _timedelta(start_date, delta_days)
773
772
 
774
- def boun_suang_heua_date(self, year: int) -> Optional[date]:
773
+ def boun_suang_heua_date(self, year: int) -> date | None:
775
774
  """Calculate the estimated Gregorian date of Ok Boun Suang Huea.
776
775
 
777
776
  Boun Suang Huea Nakhone Luang Prabang, also known as "Vientiane Boat Racing Festival".
@@ -808,7 +807,7 @@ class _ThaiLunisolar:
808
807
  delta_days = +310
809
808
  return _timedelta(start_date, delta_days)
810
809
 
811
- def loy_krathong_date(self, year: int) -> Optional[date]:
810
+ def loy_krathong_date(self, year: int) -> date | None:
812
811
  """Calculate the estimated Gregorian date of Loy Krathong.
813
812
 
814
813
  Also known as "Boun That Louang" and "Bon Om Touk".
@@ -11,7 +11,6 @@
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
13
  from datetime import date
14
- from typing import Optional
15
14
 
16
15
  from holidays.calendars.custom import _CustomCalendar
17
16
  from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV
@@ -1422,43 +1421,43 @@ class _TibetanLunisolar:
1422
1421
  2099: (JAN, 2),
1423
1422
  }
1424
1423
 
1425
- def _get_holiday(self, holiday: str, year: int) -> tuple[Optional[date], bool]:
1424
+ def _get_holiday(self, holiday: str, year: int) -> tuple[date | None, bool]:
1426
1425
  estimated_dates = getattr(self, f"{holiday}_DATES", {})
1427
1426
  exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
1428
1427
  dt = exact_dates.get(year, estimated_dates.get(year, ()))
1429
1428
  return date(year, *dt) if dt else None, year not in exact_dates
1430
1429
 
1431
- def blessed_rainy_day_date(self, year: int) -> tuple[Optional[date], bool]:
1430
+ def blessed_rainy_day_date(self, year: int) -> tuple[date | None, bool]:
1432
1431
  return self._get_holiday(BLESSED_RAINY_DAY, year)
1433
1432
 
1434
- def birth_of_guru_rinpoche_date(self, year: int) -> tuple[Optional[date], bool]:
1433
+ def birth_of_guru_rinpoche_date(self, year: int) -> tuple[date | None, bool]:
1435
1434
  return self._get_holiday(BIRTH_OF_GURU_RINPOCHE, year)
1436
1435
 
1437
- def buddha_first_sermon_date(self, year: int) -> tuple[Optional[date], bool]:
1436
+ def buddha_first_sermon_date(self, year: int) -> tuple[date | None, bool]:
1438
1437
  return self._get_holiday(BUDDHA_FIRST_SERMON, year)
1439
1438
 
1440
- def buddha_parinirvana_date(self, year: int) -> tuple[Optional[date], bool]:
1439
+ def buddha_parinirvana_date(self, year: int) -> tuple[date | None, bool]:
1441
1440
  return self._get_holiday(BUDDHA_PARINIRVANA, year)
1442
1441
 
1443
- def day_of_offering_date(self, year: int) -> tuple[Optional[date], bool]:
1442
+ def day_of_offering_date(self, year: int) -> tuple[date | None, bool]:
1444
1443
  return self._get_holiday(DAY_OF_OFFERING, year)
1445
1444
 
1446
- def death_of_zhabdrung_date(self, year: int) -> tuple[Optional[date], bool]:
1445
+ def death_of_zhabdrung_date(self, year: int) -> tuple[date | None, bool]:
1447
1446
  return self._get_holiday(DEATH_OF_ZHABDRUNG, year)
1448
1447
 
1449
- def descending_day_of_lord_buddha_date(self, year: int) -> tuple[Optional[date], bool]:
1448
+ def descending_day_of_lord_buddha_date(self, year: int) -> tuple[date | None, bool]:
1450
1449
  return self._get_holiday(DESCENDING_DAY_OF_LORD_BUDDHA, year)
1451
1450
 
1452
- def losar_date(self, year: int) -> tuple[Optional[date], bool]:
1451
+ def losar_date(self, year: int) -> tuple[date | None, bool]:
1453
1452
  return self._get_holiday(LOSAR, year)
1454
1453
 
1455
- def thimphu_drubchen_date(self, year: int) -> tuple[Optional[date], bool]:
1454
+ def thimphu_drubchen_date(self, year: int) -> tuple[date | None, bool]:
1456
1455
  return self._get_holiday(THIMPHU_DRUBCHEN, year)
1457
1456
 
1458
- def thimphu_tshechu_date(self, year: int) -> tuple[Optional[date], bool]:
1457
+ def thimphu_tshechu_date(self, year: int) -> tuple[date | None, bool]:
1459
1458
  return self._get_holiday(THIMPHU_TSHECHU, year)
1460
1459
 
1461
- def tibetan_winter_solstice_date(self, year: int) -> tuple[Optional[date], bool]:
1460
+ def tibetan_winter_solstice_date(self, year: int) -> tuple[date | None, bool]:
1462
1461
  return self._get_holiday(WINTER_SOLSTICE, year)
1463
1462
 
1464
1463
 
@@ -293,6 +293,7 @@ from holidays.countries.vatican_city import VaticanCity, VA, VAT
293
293
  from holidays.countries.venezuela import Venezuela, VE, VEN
294
294
  from holidays.countries.vietnam import Vietnam, VN, VNM
295
295
  from holidays.countries.wallis_and_futuna import WallisAndFutuna, WF, WLF, HolidaysWF
296
+ from holidays.countries.western_sahara import WesternSahara, EH, ESH
296
297
  from holidays.countries.yemen import Yemen, YE, YEM
297
298
  from holidays.countries.zambia import Zambia, ZM, ZMB
298
299
  from holidays.countries.zimbabwe import Zimbabwe, ZW, ZWE
@@ -12,7 +12,6 @@
12
12
 
13
13
  from datetime import date
14
14
  from gettext import gettext as tr
15
- from typing import Optional
16
15
 
17
16
  from holidays.calendars.gregorian import AUG, SEP
18
17
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
@@ -62,7 +61,7 @@ class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
62
61
  # it rolls over to the following Monday.
63
62
  return dt >= date(1996, SEP, 27)
64
63
 
65
- def _add_observed(self, dt: date, **kwargs) -> tuple[bool, Optional[date]]:
64
+ def _add_observed(self, dt: date, **kwargs) -> tuple[bool, date | None]:
66
65
  # As per Law # #11/18, from 2018/9/10, when public holiday falls on Tuesday or Thursday,
67
66
  # the Monday or Friday is also a holiday.
68
67
  kwargs.setdefault(
@@ -124,7 +124,7 @@ class Austria(HolidayBase, ChristianHolidays, InternationalHolidays):
124
124
 
125
125
  def _populate_subdiv_1_bank_holidays(self):
126
126
  # Saint Martin's Day.
127
- self._add_holiday_nov_11(tr("Hl. Martin"))
127
+ self._add_saint_martins_day(tr("Hl. Martin"))
128
128
 
129
129
  def _populate_subdiv_2_bank_holidays(self):
130
130
  # Saint Joseph's Day.
@@ -172,7 +172,7 @@ class Azerbaijan(ObservedHolidayBase, InternationalHolidays, IslamicHolidays, St
172
172
  continue
173
173
  for holiday_name in dt_holidays:
174
174
  if any(bayrami_name in holiday_name for bayrami_name in bayrami_names):
175
- self._add_observed(dt_observed, holiday_name, WORKDAY_TO_NEXT_WORKDAY)
175
+ self._add_observed(dt_observed, holiday_name, rule=WORKDAY_TO_NEXT_WORKDAY)
176
176
 
177
177
  def _populate_workday_holidays(self):
178
178
  if self._year >= 2021:
@@ -12,9 +12,8 @@
12
12
 
13
13
  from datetime import date
14
14
  from gettext import gettext as tr
15
- from typing import Optional
16
15
 
17
- from holidays.calendars.gregorian import MAR, APR, JUN, JUL, SEP
16
+ from holidays.calendars.gregorian import APR, SEP
18
17
  from holidays.constants import GOVERNMENT, OPTIONAL, PUBLIC
19
18
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
20
19
  from holidays.observed_holiday_base import (
@@ -101,9 +100,6 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
101
100
  kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
102
101
  super().__init__(*args, **kwargs)
103
102
 
104
- def _get_nearest_monday(self, *args) -> Optional[date]:
105
- return self._get_observed_date(date(self._year, *args), rule=ALL_TO_NEAREST_MON)
106
-
107
103
  def _add_statutory_holidays(self):
108
104
  """Nationwide statutory holidays."""
109
105
 
@@ -336,24 +332,42 @@ class Canada(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
336
332
 
337
333
  def _populate_subdiv_nl_optional_holidays(self):
338
334
  if self._year >= 1900:
339
- # Saint Patrick's Day.
340
- self._add_holiday(tr("Saint Patrick's Day"), self._get_nearest_monday(MAR, 17))
335
+ self._move_holiday_forced(
336
+ # Saint Patrick's Day.
337
+ self._add_saint_patricks_day(tr("Saint Patrick's Day")),
338
+ rule=ALL_TO_NEAREST_MON,
339
+ )
341
340
 
342
341
  if self._year >= 1990:
343
342
  # Nearest Monday to April 23
344
343
  # 4/26 is the Monday closer to 4/23 in 2010
345
344
  # but the holiday was observed on 4/19? Crazy Newfies!
346
- dt = date(2010, APR, 19) if self._year == 2010 else self._get_nearest_monday(APR, 23)
345
+
347
346
  # Saint George's Day.
348
- self._add_holiday(tr("Saint George's Day"), dt)
347
+ name = tr("Saint George's Day")
348
+
349
+ if self._year == 2010:
350
+ self._add_holiday_apr_19(name)
351
+ else:
352
+ # Prevents overlap with Good Friday.
353
+ self._add_holiday(
354
+ name,
355
+ self._get_observed_date(date(self._year, APR, 23), rule=ALL_TO_NEAREST_MON),
356
+ )
349
357
 
350
358
  if self._year >= 1997:
351
- # Discovery Day.
352
- self._add_holiday(tr("Discovery Day"), self._get_nearest_monday(JUN, 24))
359
+ self._move_holiday_forced(
360
+ # Discovery Day.
361
+ self._add_holiday_jun_24(tr("Discovery Day")),
362
+ rule=ALL_TO_NEAREST_MON,
363
+ )
353
364
 
354
365
  if self._year >= 1900:
355
- # Orangemen's Day.
356
- self._add_holiday(tr("Orangemen's Day"), self._get_nearest_monday(JUL, 12))
366
+ self._move_holiday_forced(
367
+ # Orangemen's Day.
368
+ self._add_holiday_jul_12(tr("Orangemen's Day")),
369
+ rule=ALL_TO_NEAREST_MON,
370
+ )
357
371
 
358
372
  self._add_thanksgiving_day()
359
373
 
@@ -22,14 +22,21 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
22
22
 
23
23
  References:
24
24
  * <https://en.wikipedia.org/wiki/Public_holidays_in_Denmark>
25
+ * <https://da.wikipedia.org/wiki/Danske_helligdage>
26
+ * <https://da.wikipedia.org/wiki/Helligdagsreformen_af_1770>
25
27
  * <https://web.archive.org/web/20250422010005/https://www.norden.org/en/info-norden/public-holidays-denmark>
26
28
  * <https://web.archive.org/web/20231219155820/http://www.ft.dk/samling/20222/lovforslag/l13/index.htm>
29
+ * <https://web.archive.org/web/20250119084025/https://www.retsinformation.dk/eli/lta/2023/214>
30
+ * <https://web.archive.org/web/20251016080453/https://cphpost.dk/2025-05-01/life-in-denmark/what-happens-on-the-1st-of-may/>
31
+ * <https://web.archive.org/web/20140202200655/https://bibliotek.kk.dk/biblioteker/blog/grundlovsdag-dens-traditioner>
27
32
  """
28
33
 
29
34
  country = "DK"
30
35
  default_language = "da"
36
+ # The Helligdagsreformen af 1770 was in effect from October 16th, 1770 onwards.
37
+ start_year = 1771
31
38
  supported_categories = (OPTIONAL, PUBLIC)
32
- supported_languages = ("da", "en_US", "uk")
39
+ supported_languages = ("da", "en_US", "th", "uk")
33
40
 
34
41
  def __init__(self, *args, **kwargs):
35
42
  ChristianHolidays.__init__(self)
@@ -52,6 +59,7 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
52
59
  # Easter Monday.
53
60
  self._add_easter_monday(tr("Anden påskedag"))
54
61
 
62
+ # Removed via Act no. 214 of 06/03/2023, in effect January 1st, 2024.
55
63
  if self._year <= 2023:
56
64
  # Great Day of Prayers.
57
65
  self._add_holiday_26_days_past_easter(tr("Store bededag"))
@@ -72,11 +80,15 @@ class Denmark(HolidayBase, ChristianHolidays, InternationalHolidays):
72
80
  self._add_christmas_day_two(tr("Anden juledag"))
73
81
 
74
82
  def _populate_optional_holidays(self):
75
- # Workers' Day.
76
- self._add_labor_day(tr("Arbejdernes kampdag"))
77
-
78
- # Constitution Day.
79
- self._add_holiday_jun_5(tr("Grundlovsdag"))
83
+ # First observance in 1890.
84
+ if self._year >= 1890:
85
+ # Workers' Day.
86
+ self._add_labor_day(tr("Arbejdernes kampdag"))
87
+
88
+ # Gained its statutory day-off status in 1891.
89
+ if self._year >= 1891:
90
+ # Constitution Day.
91
+ self._add_holiday_jun_5(tr("Grundlovsdag"))
80
92
 
81
93
  # Christmas Eve.
82
94
  self._add_christmas_eve(tr("Juleaftensdag"))
@@ -108,11 +108,10 @@ class Fiji(
108
108
  self._add_observed(self._add_holiday_sep_7("Constitution Day"))
109
109
 
110
110
  if self._year >= 2023:
111
- # Girmit Day.
112
- self._move_holiday(
111
+ self._move_holiday_forced(
112
+ # Girmit Day.
113
113
  self._add_holiday_may_14("Girmit Day"),
114
114
  rule=ALL_TO_NEAREST_MON,
115
- show_observed_label=False,
116
115
  )
117
116
 
118
117
  # Ratu Sir Lala Sukuna Day.
@@ -215,14 +215,13 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
215
215
  # Become a Flag Day in 1952.
216
216
  # Also considered the "Day of Finnish Heritage" from 1978 onward.
217
217
  if self._year >= 1952:
218
- name = (
218
+ self._add_holiday_may_12(
219
219
  # J. V. Snellman Day, Day of Finnish Heritage.
220
220
  tr("J.V. Snellmanin päivä, suomalaisuuden päivä")
221
221
  if self._year >= 1978
222
222
  # J. V. Snellman Day.
223
223
  else tr("J.V. Snellmanin päivä")
224
224
  )
225
- self._add_holiday_may_12(name)
226
225
 
227
226
  # Become a Flag Day in 1977.
228
227
  if self._year >= 1977:
@@ -248,14 +247,13 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
248
247
  # Become a Flag Day in 1950.
249
248
  # Also considered the "Day of Finnish Literature" from 1978 onward.
250
249
  if self._year >= 1950:
251
- name = (
250
+ self._add_holiday_oct_10(
252
251
  # Aleksis Kivi Day, Day of Finnish Literature.
253
252
  tr("Aleksis Kiven päivä, suomalaisen kirjallisuuden päivä")
254
253
  if self._year >= 1978
255
254
  # Aleksis Kivi Day.
256
255
  else tr("Aleksis Kiven päivä")
257
256
  )
258
- self._add_holiday_oct_10(name)
259
257
 
260
258
  # Become a Flag Day in 1987.
261
259
  if self._year >= 1987:
@@ -310,14 +308,13 @@ class Finland(HolidayBase, ChristianHolidays, InternationalHolidays):
310
308
  # Become a Flag Day in 1942.
311
309
  # Got its current name in 1950.
312
310
  if self._year >= 1942:
313
- name = (
311
+ self._add_holiday_jun_6(
314
312
  # Flag Day of the Finnish Defense Forces.
315
313
  tr("Puolustusvoimain lippujuhlan päivä")
316
314
  if self._year >= 1950
317
315
  # Birthday of the Marshal of Finland.
318
316
  else tr("Suomen marsalkan syntymäpäivä")
319
317
  )
320
- self._add_holiday_jun_6(name)
321
318
 
322
319
  # Day of the Finnish Flag was first created in 1934.
323
320
  # This coincides with Midsummer Day.
@@ -11,7 +11,6 @@
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
13
  from datetime import date
14
- from typing import Optional
15
14
 
16
15
  from holidays.calendars.gregorian import JAN, APR, MAY, JUN, JUL, SEP, OCT, DEC
17
16
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
@@ -53,7 +52,7 @@ class Guernsey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St
53
52
  kwargs.setdefault("observed_since", 1955)
54
53
  ObservedHolidayBase.__init__(self, *args, **kwargs)
55
54
 
56
- def _add_observed(self, dt: date, **kwargs) -> tuple[bool, Optional[date]]:
55
+ def _add_observed(self, dt: date, **kwargs) -> tuple[bool, date | None]:
57
56
  # Prior to 2009, in-lieu are only given for Sundays.
58
57
  # https://web.archive.org/web/20230930101652/https://guernseylegalresources.gg/CHttpHandler.ashx?documentid=55179
59
58
  kwargs.setdefault(