holidays 0.49__py3-none-any.whl → 0.51__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 (67) hide show
  1. holidays/__init__.py +12 -1
  2. holidays/countries/__init__.py +1 -0
  3. holidays/countries/aruba.py +2 -2
  4. holidays/countries/azerbaijan.py +1 -1
  5. holidays/countries/bahamas.py +4 -4
  6. holidays/countries/bangladesh.py +1 -1
  7. holidays/countries/belarus.py +1 -1
  8. holidays/countries/belize.py +1 -1
  9. holidays/countries/botswana.py +19 -9
  10. holidays/countries/brazil.py +14 -8
  11. holidays/countries/brunei.py +1 -1
  12. holidays/countries/canada.py +3 -3
  13. holidays/countries/chile.py +14 -11
  14. holidays/countries/curacao.py +2 -2
  15. holidays/countries/georgia.py +17 -1
  16. holidays/countries/greenland.py +96 -0
  17. holidays/countries/hongkong.py +2 -2
  18. holidays/countries/india.py +29 -23
  19. holidays/countries/ireland.py +1 -1
  20. holidays/countries/isle_of_man.py +3 -8
  21. holidays/countries/israel.py +1 -2
  22. holidays/countries/italy.py +161 -129
  23. holidays/countries/japan.py +38 -30
  24. holidays/countries/jersey.py +9 -7
  25. holidays/countries/malaysia.py +5 -5
  26. holidays/countries/mexico.py +1 -1
  27. holidays/countries/monaco.py +5 -7
  28. holidays/countries/papua_new_guinea.py +7 -6
  29. holidays/countries/russia.py +18 -4
  30. holidays/countries/saudi_arabia.py +1 -2
  31. holidays/countries/sweden.py +1 -1
  32. holidays/countries/switzerland.py +17 -15
  33. holidays/countries/tanzania.py +10 -10
  34. holidays/countries/tonga.py +10 -10
  35. holidays/countries/turkey.py +1 -1
  36. holidays/countries/united_arab_emirates.py +3 -3
  37. holidays/countries/united_states.py +4 -5
  38. holidays/deprecation.py +33 -0
  39. holidays/locale/da/LC_MESSAGES/GL.mo +0 -0
  40. holidays/locale/da/LC_MESSAGES/GL.po +91 -0
  41. holidays/locale/en_US/LC_MESSAGES/GE.mo +0 -0
  42. holidays/locale/en_US/LC_MESSAGES/GE.po +8 -4
  43. holidays/locale/en_US/LC_MESSAGES/GL.mo +0 -0
  44. holidays/locale/en_US/LC_MESSAGES/GL.po +92 -0
  45. holidays/locale/en_US/LC_MESSAGES/RU.mo +0 -0
  46. holidays/locale/en_US/LC_MESSAGES/RU.po +11 -2
  47. holidays/locale/ka/LC_MESSAGES/GE.mo +0 -0
  48. holidays/locale/ka/LC_MESSAGES/GE.po +8 -4
  49. holidays/locale/kl/LC_MESSAGES/GL.mo +0 -0
  50. holidays/locale/kl/LC_MESSAGES/GL.po +91 -0
  51. holidays/locale/{pap → pap_AW}/LC_MESSAGES/AW.mo +0 -0
  52. holidays/locale/{pap → pap_AW}/LC_MESSAGES/AW.po +1 -1
  53. holidays/locale/{pap → pap_CW}/LC_MESSAGES/CW.mo +0 -0
  54. holidays/locale/{pap → pap_CW}/LC_MESSAGES/CW.po +2 -2
  55. holidays/locale/ru/LC_MESSAGES/RU.mo +0 -0
  56. holidays/locale/ru/LC_MESSAGES/RU.po +11 -2
  57. holidays/locale/uk/LC_MESSAGES/GE.mo +0 -0
  58. holidays/locale/uk/LC_MESSAGES/GE.po +8 -4
  59. holidays/observed_holiday_base.py +42 -25
  60. holidays/registry.py +11 -1
  61. holidays/utils.py +1 -1
  62. {holidays-0.49.dist-info → holidays-0.51.dist-info}/AUTHORS +3 -0
  63. {holidays-0.49.dist-info → holidays-0.51.dist-info}/METADATA +15 -10
  64. {holidays-0.49.dist-info → holidays-0.51.dist-info}/RECORD +67 -59
  65. {holidays-0.49.dist-info → holidays-0.51.dist-info}/LICENSE +0 -0
  66. {holidays-0.49.dist-info → holidays-0.51.dist-info}/WHEEL +0 -0
  67. {holidays-0.49.dist-info → holidays-0.51.dist-info}/top_level.txt +0 -0
@@ -10,129 +10,128 @@
10
10
  # Website: https://github.com/vacanza/python-holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from holidays.groups import ChristianHolidays, InternationalHolidays
13
+ from holidays.calendars.gregorian import MAR
14
+ from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
14
15
  from holidays.holiday_base import HolidayBase
15
16
 
16
17
 
17
- class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
18
+ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
19
+ """
20
+ References:
21
+ - https://en.wikipedia.org/wiki/Public_holidays_in_Italy
22
+ - `Provinces holidays <https://it.wikipedia.org/wiki/Santi_patroni_cattolici_delle_citt%C3%A0_capoluogo_di_provincia_italiane>`_
23
+ """
24
+
18
25
  country = "IT"
19
- # Reference: https://it.wikipedia.org/wiki/Province_d%27Italia
20
- # Please maintain in alphabetical order for easy updating in the future
21
- # The alphabetical order is except cities of provinces with multiple head
22
- # cities that directly follows the main province id like BT, Barletta,
23
- # Andria, Trani, for easily grouping them.
24
- # In that case if you use the 2 char id you'll take the first Santo
25
- # Patrono defined. If you want one specific you'll have to use
26
- # the full name of the city like "Andria" instead of "BT".
27
26
  subdivisions = (
28
27
  # Provinces.
29
- "AG",
30
- "AL",
31
- "AN",
32
- "AO",
33
- "AP",
34
- "AQ",
35
- "AR",
36
- "AT",
37
- "AV",
38
- "BA",
39
- "BG",
40
- "BI",
41
- "BL",
42
- "BN",
43
- "BO",
44
- "BR",
45
- "BS",
46
- "BT",
47
- "BZ",
48
- "CA",
49
- "CB",
50
- "CE",
51
- "CH",
52
- "CL",
53
- "CN",
54
- "CO",
55
- "CR",
56
- "CS",
57
- "CT",
58
- "CZ",
59
- "EN",
60
- "FC",
61
- "FE",
62
- "FG",
63
- "FI",
64
- "FM",
65
- "FR",
66
- "GE",
67
- "GO",
68
- "GR",
69
- "IM",
70
- "IS",
71
- "KR",
72
- "LC",
73
- "LE",
74
- "LI",
75
- "LO",
76
- "LT",
77
- "LU",
78
- "MB",
79
- "MC",
80
- "ME",
81
- "MI",
82
- "MN",
83
- "MO",
84
- "MS",
85
- "MT",
86
- "NA",
87
- "NO",
88
- "NU",
89
- "OR",
90
- "PA",
91
- "PC",
92
- "PD",
93
- "PE",
94
- "PG",
95
- "PI",
96
- "PN",
97
- "PO",
98
- "PR",
99
- "PT",
100
- "PU",
101
- "PV",
102
- "PZ",
103
- "RA",
104
- "RC",
105
- "RE",
106
- "RG",
107
- "RI",
108
- "RM",
109
- "RN",
110
- "RO",
111
- "SA",
112
- "SI",
113
- "SO",
114
- "SP",
115
- "SR",
116
- "SS",
117
- "SU",
118
- "SV",
119
- "TA",
120
- "TE",
121
- "TN",
122
- "TO",
123
- "TP",
124
- "TR",
125
- "TS",
126
- "TV",
127
- "UD",
128
- "VA",
129
- "VB",
130
- "VC",
131
- "VE",
132
- "VI",
133
- "VR",
134
- "VT",
135
- "VV",
28
+ "AG", # Agrigento.
29
+ "AL", # Alessandria.
30
+ "AN", # Ancona.
31
+ "AO", # Aosta (deprecated).
32
+ "AP", # Ascoli Piceno.
33
+ "AQ", # L'Aquila.
34
+ "AR", # Arezzo.
35
+ "AT", # Asti.
36
+ "AV", # Avellino.
37
+ "BA", # Bari.
38
+ "BG", # Bergamo.
39
+ "BI", # Biella.
40
+ "BL", # Belluno.
41
+ "BN", # Benevento.
42
+ "BO", # Bologna.
43
+ "BR", # Brindisi.
44
+ "BS", # Brescia.
45
+ "BT", # Barletta-Andria-Trani.
46
+ "BZ", # Bolzano.
47
+ "CA", # Cagliari.
48
+ "CB", # Campobasso.
49
+ "CE", # Caserta.
50
+ "CH", # Chieti.
51
+ "CL", # Caltanissetta.
52
+ "CN", # Cuneo.
53
+ "CO", # Como.
54
+ "CR", # Cremona.
55
+ "CS", # Cosenza.
56
+ "CT", # Catania.
57
+ "CZ", # Catanzaro.
58
+ "EN", # Enna.
59
+ "FC", # Forlì-Cesena.
60
+ "FE", # Ferrara.
61
+ "FG", # Foggia.
62
+ "FI", # Firenze.
63
+ "FM", # Fermo.
64
+ "FR", # Frosinone.
65
+ "GE", # Genova.
66
+ "GO", # Gorizia.
67
+ "GR", # Grosseto.
68
+ "IM", # Imperia.
69
+ "IS", # Isernia.
70
+ "KR", # Crotone.
71
+ "LC", # Lecco.
72
+ "LE", # Lecce.
73
+ "LI", # Livorno.
74
+ "LO", # Lodi.
75
+ "LT", # Latina.
76
+ "LU", # Lucca.
77
+ "MB", # Monza e Brianza.
78
+ "MC", # Macerata.
79
+ "ME", # Messina.
80
+ "MI", # Milano.
81
+ "MN", # Mantova.
82
+ "MO", # Modena.
83
+ "MS", # Massa-Carrara.
84
+ "MT", # Matera.
85
+ "NA", # Napoli.
86
+ "NO", # Novara.
87
+ "NU", # Nuoro.
88
+ "OR", # Oristano.
89
+ "PA", # Palermo.
90
+ "PC", # Piacenza.
91
+ "PD", # Padova.
92
+ "PE", # Pescara.
93
+ "PG", # Perugia.
94
+ "PI", # Pisa.
95
+ "PN", # Pordenone.
96
+ "PO", # Prato.
97
+ "PR", # Parma.
98
+ "PT", # Pistoia.
99
+ "PU", # Pesaro e Urbino.
100
+ "PV", # Pavia.
101
+ "PZ", # Potenza.
102
+ "RA", # Ravenna.
103
+ "RC", # Reggio Calabria.
104
+ "RE", # Reggio Emilia.
105
+ "RG", # Ragusa.
106
+ "RI", # Rieti.
107
+ "RM", # Roma.
108
+ "RN", # Rimini.
109
+ "RO", # Rovigo.
110
+ "SA", # Salerno.
111
+ "SI", # Siena.
112
+ "SO", # Sondrio.
113
+ "SP", # La Spezia.
114
+ "SR", # Siracusa.
115
+ "SS", # Sassari.
116
+ "SU", # Sud Sardegna.
117
+ "SV", # Savona.
118
+ "TA", # Taranto.
119
+ "TE", # Teramo.
120
+ "TN", # Trento.
121
+ "TO", # Torino.
122
+ "TP", # Trapani.
123
+ "TR", # Terni.
124
+ "TS", # Trieste.
125
+ "TV", # Treviso.
126
+ "UD", # Udine.
127
+ "VA", # Varese.
128
+ "VB", # Verbano-Cusio-Ossola.
129
+ "VC", # Vercelli.
130
+ "VE", # Venezia.
131
+ "VI", # Vicenza.
132
+ "VR", # Verona.
133
+ "VT", # Viterbo.
134
+ "VV", # Vibo Valentia.
136
135
  # Cities.
137
136
  "Andria",
138
137
  "Barletta",
@@ -148,6 +147,7 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
148
147
  def __init__(self, *args, **kwargs):
149
148
  ChristianHolidays.__init__(self)
150
149
  InternationalHolidays.__init__(self)
150
+ StaticHolidays.__init__(self, cls=ItalyStaticHolidays)
151
151
  super().__init__(*args, **kwargs)
152
152
 
153
153
  def _populate_public_holidays(self):
@@ -157,6 +157,10 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
157
157
  # Epiphany.
158
158
  self._add_epiphany_day("Epifania del Signore")
159
159
 
160
+ if self._year <= 1976:
161
+ # Saint Joseph's Day.
162
+ self._add_saint_josephs_day("San Giuseppe")
163
+
160
164
  # Easter Sunday.
161
165
  self._add_easter_sunday("Pasqua di Resurrezione")
162
166
 
@@ -174,27 +178,39 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
174
178
  # Republic Day.
175
179
  self._add_holiday_jun_2("Festa della Repubblica")
176
180
 
181
+ if self._year <= 1976:
182
+ # Ascension Day.
183
+ self._add_ascension_thursday("Ascensione Nostro Signore")
184
+
185
+ # Saints Peter and Paul.
186
+ self._add_saints_peter_and_paul_day("Santi Pietro e Paolo")
187
+
188
+ # Corpus Christi.
189
+ self._add_corpus_christi_day("Corpus Domini")
190
+
177
191
  # Assumption Of Mary Day.
178
192
  self._add_assumption_of_mary_day("Assunzione della Vergine")
179
193
 
180
194
  # All Saints' Day.
181
195
  self._add_all_saints_day("Tutti i Santi")
182
196
 
183
- # Immaculate Conception Day.
197
+ if self._year <= 1976:
198
+ # National Unity and Armed Forces Day.
199
+ self._add_holiday_nov_4("Giornata dell'Unità Nazionale e delle Forze Armate")
200
+
201
+ # Immaculate Conception.
184
202
  self._add_immaculate_conception_day("Immacolata Concezione")
185
203
 
186
204
  # Christmas Day.
187
205
  self._add_christmas_day("Natale")
188
206
 
189
- self._add_christmas_day_two("Santo Stefano")
207
+ if self._year >= 1947:
208
+ # Saint Stephen's Day.
209
+ self._add_christmas_day_two("Santo Stefano")
190
210
 
191
211
  if self.subdiv == "Forlì":
192
212
  self._populate_subdiv_forli_public_holidays()
193
213
 
194
- # Provinces holidays.
195
- # https://it.wikipedia.org/wiki/Santi_patroni_cattolici_delle_citt%C3%A0_capoluogo_di_provincia_italiane
196
- # Please maintain in alphabetical order for easy updating in the future.
197
-
198
214
  def _populate_subdiv_ag_public_holidays(self):
199
215
  self._add_holiday_feb_25("San Gerlando")
200
216
 
@@ -241,11 +257,12 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
241
257
  self._add_holiday_oct_4("San Petronio")
242
258
 
243
259
  def _populate_subdiv_br_public_holidays(self):
244
- self._add_holiday_1st_sun_of_sep("San Teodoro d'Amasea e San Lorenzo da Brindisi")
260
+ self._add_holiday_1st_sun_of_sep("San Lorenzo da Brindisi")
245
261
 
246
262
  def _populate_subdiv_bs_public_holidays(self):
247
263
  self._add_holiday_feb_15("Santi Faustino e Giovita")
248
264
 
265
+ # Barletta-Andria-Trani
249
266
  def _populate_subdiv_bt_public_holidays(self):
250
267
  self._add_holiday_may_3("San Nicola Pellegrino")
251
268
  self._add_holiday_3rd_sun_of_sep("San Riccardo di Andria")
@@ -291,6 +308,7 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
291
308
  def _populate_subdiv_en_public_holidays(self):
292
309
  self._add_holiday_jul_2("Madonna della Visitazione")
293
310
 
311
+ # Forlì-Cesena
294
312
  def _populate_subdiv_fc_public_holidays(self):
295
313
  self._add_holiday_feb_4("Madonna del Fuoco")
296
314
  self._add_saint_johns_day("San Giovanni Battista")
@@ -342,7 +360,8 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
342
360
  self._add_holiday_jan_19("San Bassiano")
343
361
 
344
362
  def _populate_subdiv_lt_public_holidays(self):
345
- self._add_holiday_apr_25("San Marco evangelista")
363
+ self._add_holiday_apr_25("San Marco Evangelista")
364
+ self._add_holiday_jul_6("Santa Maria Goretti")
346
365
 
347
366
  def _populate_subdiv_lu_public_holidays(self):
348
367
  self._add_holiday_jul_12("San Paolino di Lucca")
@@ -384,7 +403,7 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
384
403
  self._add_holiday_feb_13("Sant'Archelao")
385
404
 
386
405
  def _populate_subdiv_pa_public_holidays(self):
387
- self._add_holiday_jul_15("San Giovanni")
406
+ self._add_holiday_jul_15("Santa Rosalia")
388
407
 
389
408
  def _populate_subdiv_pc_public_holidays(self):
390
409
  self._add_holiday_jul_4("Sant'Antonino di Piacenza")
@@ -396,7 +415,8 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
396
415
  self._add_holiday_oct_10("San Cetteo")
397
416
 
398
417
  def _populate_subdiv_pg_public_holidays(self):
399
- self._add_holiday_jan_29("Sant'Ercolano e San Lorenzo")
418
+ self._add_holiday_aug_11("Santa Chiara d'Assisi")
419
+ self._add_holiday_oct_4("San Francesco d'Assisi")
400
420
 
401
421
  def _populate_subdiv_pi_public_holidays(self):
402
422
  self._add_holiday_jun_17("San Ranieri")
@@ -414,6 +434,7 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
414
434
  def _populate_subdiv_pt_public_holidays(self):
415
435
  self._add_saint_james_day("San Jacopo")
416
436
 
437
+ # Pesaro e Urbino
417
438
  def _populate_subdiv_pu_public_holidays(self):
418
439
  self._add_holiday_jun_1("San Crescentino")
419
440
  self._add_holiday_sep_24("San Terenzio di Pesaro")
@@ -434,7 +455,8 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
434
455
  self._add_holiday_nov_24("San Prospero Vescovo")
435
456
 
436
457
  def _populate_subdiv_rg_public_holidays(self):
437
- self._add_saint_georges_day("San Giorgio")
458
+ self._add_saint_georges_day("San Giorgio Martire")
459
+ self._add_holiday_aug_29("San Giovanni Battista")
438
460
 
439
461
  def _populate_subdiv_ri_public_holidays(self):
440
462
  self._add_holiday_dec_4("Santa Barbara")
@@ -467,6 +489,7 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
467
489
  self._add_holiday_dec_6("San Nicola")
468
490
 
469
491
  def _populate_subdiv_su_public_holidays(self):
492
+ # Carbonia.
470
493
  self._add_holiday_4_days_past_2nd_sun_of_may("San Ponziano")
471
494
 
472
495
  def _populate_subdiv_sv_public_holidays(self):
@@ -512,7 +535,7 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays):
512
535
  self._add_holiday_apr_25("San Marco Evangelista")
513
536
 
514
537
  def _populate_subdiv_vi_public_holidays(self):
515
- self._add_holiday_apr_25("San Marco")
538
+ self._add_nativity_of_mary_day("Madonna di Monte Berico")
516
539
 
517
540
  def _populate_subdiv_vr_public_holidays(self):
518
541
  self._add_holiday_may_21("San Zeno")
@@ -551,3 +574,12 @@ class IT(Italy):
551
574
 
552
575
  class ITA(Italy):
553
576
  pass
577
+
578
+
579
+ class ItalyStaticHolidays:
580
+ # Anniversary of the Unification of Italy.
581
+ anniversary_of_unification = "Anniversario dell'Unità d'Italia"
582
+ special_public_holidays = {
583
+ 1961: (MAR, 17, anniversary_of_unification),
584
+ 2011: (MAR, 17, anniversary_of_unification),
585
+ }
@@ -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 Set, Tuple
16
16
 
17
17
  from holidays.calendars.gregorian import (
18
18
  FEB,
@@ -29,11 +29,10 @@ from holidays.calendars.gregorian import (
29
29
  )
30
30
  from holidays.constants import BANK, PUBLIC
31
31
  from holidays.groups import InternationalHolidays, StaticHolidays
32
- from holidays.helpers import _normalize_tuple
33
- from holidays.holiday_base import HolidayBase
32
+ from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_WORKDAY
34
33
 
35
34
 
36
- class Japan(HolidayBase, InternationalHolidays, StaticHolidays):
35
+ class Japan(ObservedHolidayBase, InternationalHolidays, StaticHolidays):
37
36
  """
38
37
  References:
39
38
 
@@ -49,8 +48,33 @@ class Japan(HolidayBase, InternationalHolidays, StaticHolidays):
49
48
  def __init__(self, *args, **kwargs) -> None:
50
49
  InternationalHolidays.__init__(self)
51
50
  StaticHolidays.__init__(self, cls=JapanStaticHolidays)
51
+ kwargs.setdefault("observed_rule", SUN_TO_NEXT_WORKDAY)
52
52
  super().__init__(*args, **kwargs)
53
53
 
54
+ def _populate_observed(self, dts: Set[date]) -> None:
55
+ # When a national holiday falls on Sunday, next working day
56
+ # shall become a public holiday (振替休日) - substitute holidays.
57
+ for dt in sorted(dts):
58
+ is_observed, dt_observed = self._add_observed(
59
+ dt,
60
+ # Substitute Holiday.
61
+ name=tr("振替休日"),
62
+ show_observed_label=False,
63
+ )
64
+ if is_observed:
65
+ dts.add(dt_observed) # type: ignore[arg-type]
66
+
67
+ # A weekday between national holidays becomes
68
+ # a holiday too (国民の休日) - national holidays.
69
+ for dt in dts:
70
+ if _timedelta(dt, +2) not in dts:
71
+ continue
72
+ dt_observed = _timedelta(dt, +1)
73
+ if self._is_sunday(dt_observed) or dt_observed in dts:
74
+ continue
75
+ # National Holiday.
76
+ self._add_holiday(tr("国民の休日"), dt_observed)
77
+
54
78
  def _populate_public_holidays(self):
55
79
  if self._year < 1949 or self._year > 2099:
56
80
  raise NotImplementedError
@@ -172,32 +196,7 @@ class Japan(HolidayBase, InternationalHolidays, StaticHolidays):
172
196
  dts_observed.add(self._add_holiday_dec_23(tr("天皇誕生日")))
173
197
 
174
198
  if self.observed:
175
- for month, day, _ in _normalize_tuple(
176
- self.special_public_holidays.get(self._year, ())
177
- ):
178
- dts_observed.add(date(self._year, month, day))
179
-
180
- # When a national holiday falls on Sunday, next working day
181
- # shall become a public holiday (振替休日) - substitute holidays.
182
- for dt in dts_observed.copy():
183
- if not self._is_sunday(dt):
184
- continue
185
- dt_observed = _timedelta(dt, +1)
186
- while dt_observed in dts_observed:
187
- dt_observed = _timedelta(dt_observed, +1)
188
- # Substitute Holiday.
189
- dts_observed.add(self._add_holiday(tr("振替休日"), dt_observed))
190
-
191
- # A weekday between national holidays becomes
192
- # a holiday too (国民の休日) - citizens' holidays.
193
- for dt in dts_observed:
194
- if _timedelta(dt, +2) not in dts_observed:
195
- continue
196
- dt_observed = _timedelta(dt, +1)
197
- if self._is_sunday(dt_observed) or dt_observed in dts_observed:
198
- continue
199
- # National Holiday.
200
- self._add_holiday(tr("国民の休日"), dt_observed)
199
+ self._populate_observed(dts_observed)
201
200
 
202
201
  def _populate_bank_holidays(self):
203
202
  if self._year < 1949 or self._year > 2099:
@@ -246,6 +245,8 @@ class JPN(Japan):
246
245
 
247
246
 
248
247
  class JapanStaticHolidays:
248
+ national_holiday = tr("国民の休日")
249
+
249
250
  special_public_holidays = {
250
251
  1959: (APR, 10, tr("結婚の儀")), # The Crown Prince marriage ceremony.
251
252
  1989: (FEB, 24, tr("大喪の礼")), # State Funeral of Emperor Shōwa.
@@ -256,3 +257,10 @@ class JapanStaticHolidays:
256
257
  (OCT, 22, tr("即位礼正殿の儀が行われる日")), # Enthronement ceremony.
257
258
  ),
258
259
  }
260
+
261
+ special_public_holidays_observed = {
262
+ 2019: (
263
+ (APR, 30, national_holiday),
264
+ (MAY, 2, national_holiday),
265
+ ),
266
+ }
@@ -19,6 +19,8 @@ from holidays.observed_holiday_base import (
19
19
  ObservedHolidayBase,
20
20
  SAT_SUN_TO_NEXT_WORKDAY,
21
21
  SUN_TO_NEXT_WORKDAY,
22
+ SAT_TO_NONE,
23
+ SUN_TO_NONE,
22
24
  )
23
25
 
24
26
 
@@ -139,14 +141,12 @@ class Jersey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
139
141
  # Liberation Day.
140
142
  # Started in 1952. This has no in-lieus.
141
143
  # Counts as Public Holiday when fall on the weekdays, also on Saturday from 2010 onwards.
142
- # Specially held in 2010 on Sunday for the 65th Anniversary.
143
144
 
144
- # Liberation Day
145
- liberation_day = self._add_holiday_may_9("Liberation Day")
146
- if (self._is_sunday(liberation_day) and self._year != 2010) or (
147
- self._is_saturday(liberation_day) and self._year <= 2010
148
- ):
149
- self.pop(liberation_day)
145
+ self._add_observed(
146
+ # Liberation Day
147
+ self._add_holiday_may_9("Liberation Day"),
148
+ rule=SAT_TO_NONE + SUN_TO_NONE if self._year <= 2010 else SUN_TO_NONE,
149
+ )
150
150
 
151
151
 
152
152
  class JE(Jersey):
@@ -207,6 +207,8 @@ class JerseyStaticHolidays:
207
207
  1999: (DEC, 31, "Millennium Celebrations"),
208
208
  2001: (JUL, 13, elizabeth_2_royal_visit),
209
209
  2002: (JUN, 3, "Golden Jubilee of Elizabeth II"),
210
+ # Specially held in 2010 on Sunday for the 65th Anniversary.
211
+ 2010: (MAY, 9, "Liberation Day"),
210
212
  2011: (APR, 29, "Wedding of William and Catherine"),
211
213
  2012: (JUN, 5, "Diamond Jubilee of Elizabeth II"),
212
214
  2020: (MAY, 8, "75th Anniversary of VE Day"),
@@ -128,12 +128,12 @@ class Malaysia(
128
128
  def __init__(self, *args, **kwargs):
129
129
  """
130
130
  References:
131
- - `Holidays Act 1951 <https://www.kabinet.gov.my/bkpp/pdf/akta_warta/1951_12_31_act369.pdf>`_ # noqa: E501
132
- - `Holidays Ordinance (Sabah Cap. 56) <https://sagc.sabah.gov.my/sites/default/files/law/HolidaysOrdinance.pdf>`_ # noqa: E501
133
- - `Public Holidays Ordinance (Sarawak Cap. 8) <https://www.kabinet.gov.my/bkpp/pdf/akta_warta/sarawak_public_holidays_ord_chapter8.pdf>`_ # noqa: E501
131
+ - `Holidays Act 1951 <https://www.kabinet.gov.my/bkpp/pdf/akta_warta/1951_12_31_act369.pdf>`_
132
+ - `Holidays Ordinance (Sabah Cap. 56) <https://sagc.sabah.gov.my/sites/default/files/law/HolidaysOrdinance.pdf>`_
133
+ - `Public Holidays Ordinance (Sarawak Cap. 8) <https://www.kabinet.gov.my/bkpp/pdf/akta_warta/sarawak_public_holidays_ord_chapter8.pdf>`_
134
134
  - `Wikipedia <https://en.wikipedia.org/wiki/Public_holidays_in_Malaysia>`_
135
- - https://www.nst.com.my/news/nation/2020/03/571660/agongs-birthday-moved-june-6-june-8 # noqa: E501
136
- - https://www.nst.com.my/news/nation/2024/02/1014012/melaka-cm-suggests-declaring-feb-20-federal-public-holiday-mark # noqa: E501
135
+ - https://www.nst.com.my/news/nation/2020/03/571660/agongs-birthday-moved-june-6-june-8
136
+ - https://www.nst.com.my/news/nation/2024/02/1014012/melaka-cm-suggests-declaring-feb-20-federal-public-holiday-mark
137
137
 
138
138
  Section 3 of Holidays Act 1951:
139
139
  "If any day specified in the Schedule falls on Sunday then the day following shall be
@@ -23,7 +23,7 @@ class Mexico(HolidayBase, ChristianHolidays, InternationalHolidays):
23
23
  - https://es.wikipedia.org/wiki/Anexo:D%C3%ADas_festivos_en_M%C3%A9xico
24
24
  - https://www.gob.mx/cms/uploads/attachment/file/156203/1044_Ley_Federal_del_Trabajo.pdf
25
25
  - http://www.diputados.gob.mx/LeyesBiblio/ref/lft/LFT_orig_01abr70_ima.pdf
26
- - https://www.gob.mx/profedet/es/articulos/sabes-cuales-son-los-dias-de-descanso-obligatorio-para-este-2024 # noqa: E501
26
+ - https://www.gob.mx/profedet/es/articulos/sabes-cuales-son-los-dias-de-descanso-obligatorio-para-este-2024
27
27
  """
28
28
 
29
29
  country = "MX"
@@ -12,7 +12,7 @@
12
12
 
13
13
  from gettext import gettext as tr
14
14
 
15
- from holidays.calendars.gregorian import JAN, DEC
15
+ from holidays.calendars.gregorian import JAN
16
16
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
17
17
  from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON
18
18
 
@@ -20,7 +20,7 @@ from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON
20
20
  class Monaco(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
21
21
  """
22
22
  https://en.wikipedia.org/wiki/Public_holidays_in_Monaco
23
- https://en.service-public-entreprises.gouv.mc/Employment-and-social-affairs/Employment-regulations/Leave/Public-Holidays # noqa: E501
23
+ https://en.service-public-entreprises.gouv.mc/Employment-and-social-affairs/Employment-regulations/Leave/Public-Holidays
24
24
  """
25
25
 
26
26
  country = "MC"
@@ -68,11 +68,9 @@ class Monaco(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
68
68
  self._add_observed(self._add_holiday_nov_19(tr("La Fête du Prince")))
69
69
 
70
70
  # Immaculate Conception.
71
- name = tr("L'Immaculée Conception")
72
- if self._year >= 2019 and self._is_sunday(DEC, 8):
73
- self._add_holiday_dec_9(name)
74
- else:
75
- self._add_holiday_dec_8(name)
71
+ dec_8 = self._add_immaculate_conception_day(tr("L'Immaculée Conception"))
72
+ if self._year >= 2019:
73
+ self._move_holiday(dec_8, show_observed_label=False)
76
74
 
77
75
  # Christmas Day.
78
76
  self._add_observed(self._add_christmas_day(tr("Noël")))
@@ -133,16 +133,17 @@ class PNG(PapuaNewGuinea):
133
133
 
134
134
  class PapuaNewGuineaStaticHolidays:
135
135
  """
136
- Starting from 2021 afterwards all state funerals are given special public holidays, though only some are day-off nationwide.
136
+ Starting from 2021 afterwards all state funerals are given special public holidays, though only
137
+ some are day-off nationwide.
137
138
 
138
139
  References:
139
- - 2018 APEC Public Holiday*: https://www.rnz.co.nz/international/pacific-news/369989/papua-new-guinea-declares-apec-holiday # noqa: E501
140
- - 2021 Sir Mekere Morauta's Funeral: https://pnghausbung.com/friday-8th-declared-a-nation-wide-public-holiday-to-honour-late-sir-mekere/ # noqa: E501
141
- - 2021 Sir Michael Somare's Day of Mourning: https://pnghausbung.com/2-weeks-mourning-period-for-late-sir-micheal-to-start-with-public-holiday-on-monday-pm/ # noqa: E501
140
+ - 2018 APEC Public Holiday*: https://www.rnz.co.nz/international/pacific-news/369989/papua-new-guinea-declares-apec-holiday
141
+ - 2021 Sir Mekere Morauta's Funeral: https://pnghausbung.com/friday-8th-declared-a-nation-wide-public-holiday-to-honour-late-sir-mekere/
142
+ - 2021 Sir Michael Somare's Day of Mourning: https://pnghausbung.com/2-weeks-mourning-period-for-late-sir-micheal-to-start-with-public-holiday-on-monday-pm/
142
143
  - 2022 QE2's Funeral: https://www.thenational.com.pg/column-1-553/
143
- - 2023 Sir Rabbie Namaliu's Funeral: https://pnghausbung.com/breaking-public-holiday-tomorrow-in-respect-of-late-sir-rabbies-state-funeral/ # noqa: E501
144
+ - 2023 Sir Rabbie Namaliu's Funeral: https://pnghausbung.com/breaking-public-holiday-tomorrow-in-respect-of-late-sir-rabbies-state-funeral/
144
145
 
145
- * Nov 15, 2018 is an APEC Holiday too, but for Port Moresby-only: https://www.businessadvantagepng.com/public-holidays-declared-in-port-moresby-due-to-apec-summit-says-ceo/ # noqa: E501
146
+ * Nov 15, 2018 is an APEC Holiday too, but for Port Moresby-only: https://www.businessadvantagepng.com/public-holidays-declared-in-port-moresby-due-to-apec-summit-says-ceo/
146
147
  """
147
148
 
148
149
  # National Day of Mourning for Sir Michael Somare.