holidays 0.62__py3-none-any.whl → 0.64__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. holidays/calendars/hebrew.py +32 -3
  2. holidays/calendars/thai.py +25 -9
  3. holidays/constants.py +1 -0
  4. holidays/countries/__init__.py +1 -0
  5. holidays/countries/afghanistan.py +104 -0
  6. holidays/countries/angola.py +22 -25
  7. holidays/countries/argentina.py +2 -3
  8. holidays/countries/azerbaijan.py +2 -2
  9. holidays/countries/belarus.py +93 -14
  10. holidays/countries/bolivia.py +1 -1
  11. holidays/countries/bosnia_and_herzegovina.py +1 -1
  12. holidays/countries/cambodia.py +6 -7
  13. holidays/countries/canada.py +1 -2
  14. holidays/countries/chile.py +10 -11
  15. holidays/countries/costa_rica.py +1 -1
  16. holidays/countries/croatia.py +1 -2
  17. holidays/countries/czechia.py +1 -1
  18. holidays/countries/dominica.py +1 -2
  19. holidays/countries/el_salvador.py +45 -24
  20. holidays/countries/france.py +18 -3
  21. holidays/countries/hungary.py +2 -2
  22. holidays/countries/israel.py +55 -81
  23. holidays/countries/kazakhstan.py +8 -2
  24. holidays/countries/latvia.py +2 -4
  25. holidays/countries/lithuania.py +1 -1
  26. holidays/countries/montenegro.py +143 -27
  27. holidays/countries/namibia.py +1 -1
  28. holidays/countries/new_zealand.py +3 -8
  29. holidays/countries/norway.py +1 -1
  30. holidays/countries/philippines.py +2 -2
  31. holidays/countries/poland.py +9 -1
  32. holidays/countries/russia.py +1 -1
  33. holidays/countries/south_korea.py +4 -8
  34. holidays/countries/thailand.py +499 -213
  35. holidays/countries/turkey.py +2 -4
  36. holidays/countries/ukraine.py +19 -10
  37. holidays/countries/united_states.py +26 -23
  38. holidays/countries/uruguay.py +8 -7
  39. holidays/financial/__init__.py +2 -2
  40. holidays/financial/european_central_bank.py +10 -3
  41. holidays/financial/ny_stock_exchange.py +82 -45
  42. holidays/groups/__init__.py +1 -0
  43. holidays/groups/christian.py +2 -0
  44. holidays/groups/custom.py +12 -0
  45. holidays/groups/hebrew.py +151 -0
  46. holidays/holiday_base.py +4 -13
  47. holidays/locale/be/LC_MESSAGES/BY.mo +0 -0
  48. holidays/locale/be/LC_MESSAGES/BY.po +53 -17
  49. holidays/locale/cnr/LC_MESSAGES/ME.mo +0 -0
  50. holidays/locale/cnr/LC_MESSAGES/ME.po +102 -0
  51. holidays/locale/en_US/LC_MESSAGES/AF.mo +0 -0
  52. holidays/locale/en_US/LC_MESSAGES/AF.po +98 -0
  53. holidays/locale/en_US/LC_MESSAGES/BY.mo +0 -0
  54. holidays/locale/en_US/LC_MESSAGES/BY.po +61 -20
  55. holidays/locale/en_US/LC_MESSAGES/ME.mo +0 -0
  56. holidays/locale/en_US/LC_MESSAGES/ME.po +102 -0
  57. holidays/locale/en_US/LC_MESSAGES/PL.mo +0 -0
  58. holidays/locale/en_US/LC_MESSAGES/PL.po +7 -5
  59. holidays/locale/en_US/LC_MESSAGES/SV.mo +0 -0
  60. holidays/locale/en_US/LC_MESSAGES/SV.po +75 -0
  61. holidays/locale/en_US/LC_MESSAGES/TH.mo +0 -0
  62. holidays/locale/en_US/LC_MESSAGES/TH.po +128 -24
  63. holidays/locale/es/LC_MESSAGES/SV.mo +0 -0
  64. holidays/locale/es/LC_MESSAGES/SV.po +75 -0
  65. holidays/locale/fa_AF/LC_MESSAGES/AF.mo +0 -0
  66. holidays/locale/fa_AF/LC_MESSAGES/AF.po +98 -0
  67. holidays/locale/pl/LC_MESSAGES/PL.mo +0 -0
  68. holidays/locale/pl/LC_MESSAGES/PL.po +8 -4
  69. holidays/locale/ps_AF/LC_MESSAGES/AF.mo +0 -0
  70. holidays/locale/ps_AF/LC_MESSAGES/AF.po +98 -0
  71. holidays/locale/ru/LC_MESSAGES/BY.mo +0 -0
  72. holidays/locale/ru/LC_MESSAGES/BY.po +111 -0
  73. holidays/locale/th/LC_MESSAGES/BY.mo +0 -0
  74. holidays/locale/th/LC_MESSAGES/BY.po +109 -0
  75. holidays/locale/th/LC_MESSAGES/NO.mo +0 -0
  76. holidays/locale/th/LC_MESSAGES/NO.po +80 -0
  77. holidays/locale/th/LC_MESSAGES/RU.mo +0 -0
  78. holidays/locale/th/LC_MESSAGES/RU.po +90 -0
  79. holidays/locale/th/LC_MESSAGES/TH.mo +0 -0
  80. holidays/locale/th/LC_MESSAGES/TH.po +127 -23
  81. holidays/locale/th/LC_MESSAGES/UA.mo +0 -0
  82. holidays/locale/th/LC_MESSAGES/UA.po +114 -0
  83. holidays/locale/uk/LC_MESSAGES/ME.mo +0 -0
  84. holidays/locale/uk/LC_MESSAGES/ME.po +102 -0
  85. holidays/locale/uk/LC_MESSAGES/PL.mo +0 -0
  86. holidays/locale/uk/LC_MESSAGES/PL.po +7 -5
  87. holidays/locale/uk/LC_MESSAGES/SV.mo +0 -0
  88. holidays/locale/uk/LC_MESSAGES/SV.po +75 -0
  89. holidays/registry.py +3 -2
  90. holidays/utils.py +1 -5
  91. holidays/version.py +1 -1
  92. {holidays-0.62.dist-info → holidays-0.64.dist-info}/AUTHORS +1 -0
  93. {holidays-0.62.dist-info → holidays-0.64.dist-info}/METADATA +22 -17
  94. {holidays-0.62.dist-info → holidays-0.64.dist-info}/RECORD +97 -67
  95. {holidays-0.62.dist-info → holidays-0.64.dist-info}/WHEEL +1 -1
  96. {holidays-0.62.dist-info → holidays-0.64.dist-info}/LICENSE +0 -0
  97. {holidays-0.62.dist-info → holidays-0.64.dist-info}/top_level.txt +0 -0
@@ -13,7 +13,21 @@
13
13
  from datetime import date
14
14
  from gettext import gettext as tr
15
15
 
16
- from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
16
+ from holidays.calendars.gregorian import (
17
+ JAN,
18
+ FEB,
19
+ MAR,
20
+ APR,
21
+ MAY,
22
+ JUN,
23
+ JUL,
24
+ AUG,
25
+ SEP,
26
+ OCT,
27
+ NOV,
28
+ DEC,
29
+ _timedelta,
30
+ )
17
31
  from holidays.constants import ARMED_FORCES, BANK, GOVERNMENT, PUBLIC, SCHOOL, WORKDAY
18
32
  from holidays.groups import InternationalHolidays, StaticHolidays, ThaiCalendarHolidays
19
33
  from holidays.observed_holiday_base import (
@@ -33,6 +47,46 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
33
47
 
34
48
  References:
35
49
  - Based on: https://en.wikipedia.org/wiki/Public_holidays_in_Thailand
50
+ `Holidays Act (MAR 1914) <https://ratchakitcha.soc.go.th/documents/1044125.pdf>`_
51
+ `Special Extension for MoJ (In-effect 1915 onwards) <https://ratchakitcha.soc.go.th/documents/1046008.pdf>`_
52
+ `Holidays Act Amendment (MAR 1926) <https://ratchakitcha.soc.go.th/documents/1073133.pdf>`_
53
+ `Ascension of HM King Ananda Mahidol (MAR 1935) <https://th.wikisource.org/wiki/ประกาศนายกรัฐมนตรี_ลงวันที่_7_มีนาคม_2477_(รก.)>`_
54
+ `Holidays Act Amendment (JAN 1938) <https://ratchakitcha.soc.go.th/documents/1105432.pdf>`_
55
+ `Translation Typo Fixed for the JAN 1938 Amendment <https://ratchakitcha.soc.go.th/documents/1105491.pdf>`_
56
+ `Constitution Petition Day renamed National Day (JUL 1938) <https://th.wikisource.org/wiki/ประกาศสำนักนายกรัฐมนตรี_ลงวันที่_18_กรกฎาคม_2481>`_
57
+ `Holidays Act Amendment (MAR 1940) <https://ratchakitcha.soc.go.th/documents/1110471.pdf>`_
58
+ `Holidays Act Amendment (SEP 1940) (In-effect 1941) <https://ratchakitcha.soc.go.th/documents/1111954.pdf>`_
59
+ `Removal of Royal Language for King's Birthday (B.E 2484/1941) <https://th.wikisource.org/wiki/ประกาศสำนักนายกรัฐมนตรี_ลงวันที่_19_กันยายน_2484>`_
60
+ `Holidays Act, Franco-Thai War Armistice Day added (B.E. 2485/1942) <https://ratchakitcha.soc.go.th/documents/1114825.pdf>`_
61
+ `Holidays Act, Franco-Thai War Armistice Day Repealed (B.E. 2487/1944) <https://ratchakitcha.soc.go.th/documents/1121365.pdf>`_
62
+ `Removal of Royal Language for King's Birthday Repealed (B.E 2488/1945) <https://th.wikisource.org/wiki/ประกาศสำนักนายกรัฐมนตรี_ลงวันที่_12_มกราคม_2488>`_
63
+ `Holidays Act Amendment (DEC B.E. 2488/1945) <https://ratchakitcha.soc.go.th/documents/1123218.pdf>`_
64
+ `Holidays Act Amendment (AUG B.E. 2489/1946) <https://ratchakitcha.soc.go.th/documents/1124494.pdf>`_
65
+ `Special Weekend Arrangement for 4 Southern Provinces (4SP) <https://ratchakitcha.soc.go.th/documents/1129175.pdf>`_
66
+ `Holidays Act, B.E. 2491 (1948) <https://ratchakitcha.soc.go.th/documents/1130817.pdf>`_
67
+ `Holidays Act (No. 2), B.E. 2493 (1950) <https://ratchakitcha.soc.go.th/documents/1141392.pdf>`_
68
+ `Holidays Act (No. 3), B.E. 2494 (1951) <https://ratchakitcha.soc.go.th/documents/1143601.pdf>`_
69
+ `HM King Bhumibol Adulyadej Birthday Holidays Adjustment <https://ratchakitcha.soc.go.th/documents/1145614.pdf>`_
70
+ `Holidays Act (No. 4), B.E. 2495 (1952) <https://ratchakitcha.soc.go.th/documents/1148403.pdf>`_
71
+ `Holidays Act (No. 6), B.E. 2497 (1954) <https://ratchakitcha.soc.go.th/documents/1159427.pdf>`_
72
+ `Holidays Act (No. 7), B.E. 2497 (1954); United Nations Day added <https://ratchakitcha.soc.go.th/documents/1160256.pdf>`_
73
+ `Holidays Act (No. 8), B.E. 2499 (1956); Mothers Day, Children's Day added <https://ratchakitcha.soc.go.th/documents/1169783.pdf>`_
74
+ `Holidays Act (No. 9), B.E. 2499 (1956); Weekend is now Buddhist Sabbath-SUN <https://ratchakitcha.soc.go.th/documents/1172667.pdf>`_
75
+ `Holidays Act (No. 10), B.E. 2500 (1957); Weekend Change Reverted <https://ratchakitcha.soc.go.th/documents/1179999.pdf>`_
76
+ `Holidays Act (No. 11), B.E. 2500 (1957) <https://ratchakitcha.soc.go.th/documents/1180042.pdf>`_
77
+ `Holidays Act (No. 12), B.E. 2502 (1959); Weekend is full day SAT-SUN <https://ratchakitcha.soc.go.th/documents/1187876.pdf>`_
78
+ `Holidays Act (No. 13), B.E. 2503 (1960); National Day is now Dec 5 <https://ratchakitcha.soc.go.th/documents/1196364.pdf>`_
79
+ `Holidays Act (No. 14), B.E. 2505 (1962); Asarnha Bucha added <https://ratchakitcha.soc.go.th/documents/1206407.pdf>`_
80
+ `Holidays Act (No. 16), B.E. 2506 (1963); 4SP weekend is now SAT-SUN <https://hr.rid.go.th/wp-content/uploads/2022/12/06-16.pdf>`_
81
+ `Eid-al-Fitr and Eit al-Adha added for 4SP <https://hr.rid.go.th/wp-content/uploads/2022/12/05-2517.pdf>`_
82
+ `Holidays Act (No. 17), B.E. 2525 (1982); Chakri Day Full Name Changed <https://ratchakitcha.soc.go.th/documents/1494132.pdf>`_
83
+ `Holidays Act (No. 19), B.E. 2540 (1997); Songkran Date Changed <https://ratchakitcha.soc.go.th/documents/1685580.pdf>`_
84
+ `Holidays Act (No. 20), B.E. 2555 (2012); CNY in 4SP <https://ratchakitcha.soc.go.th/documents/1914282.pdf>`_
85
+ `Holidays Act (No. 21), B.E. 2556 (2013); Songkhla added to 4SP <https://ratchakitcha.soc.go.th/documents/2098813.pdf>`_
86
+ `Holidays Act (No. 22), B.E. 2560 (2017); Father's Day Date Clarification <https://ratchakitcha.soc.go.th/documents/2098828.pdf>`_
87
+ `Holidays Act (No. 23), B.E. 2560 (2017); Rama X's Birthday added <https://ratchakitcha.soc.go.th/documents/2104467.pdf>`_
88
+ `HM Queen Suthida's Birthday added <https://ratchakitcha.soc.go.th/documents/17081602.pdf>`_
89
+ `Holidays Act, B.E. 2562 (2019) <https://ratchakitcha.soc.go.th/documents/17082311.pdf>`_
36
90
  - Checked with: `Bank of Thailand lists <http://tiny.cc/wa_bot_2023>`_
37
91
  - [In Lieus]
38
92
  - `isranews.org <http://tiny.cc/wa_isranews_inlieu_hist>`_
@@ -69,12 +123,14 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
69
123
  https://www.matichon.co.th/politics/news_526200
70
124
  - [HM King Chulalongkorn Memorial Day]
71
125
  `<https://th.wikipedia.org/wiki/วันปิยมหาราช>`_
126
+ - https://www.sanook.com/news/9072518/
72
127
  - [HM King Bhumibol Adulyadej's Birthday]
73
128
  - `Ministry of Culture <http://tiny.cc/wa_mincul_nat_day>`_
74
129
  - https://hilight.kapook.com/view/148862
75
130
  - [National Father's Day]
76
131
  https://www.brh.go.th/index.php/2019-02-27-04-12-21/594-5-5
77
132
  - [Constitution Day]
133
+ - https://th.wikipedia.org/wiki/วันรัฐธรรมนูญ_(ประเทศไทย)
78
134
  - https://hilight.kapook.com/view/18208
79
135
  - `Bank of Thailand <http://tiny.cc/wa_bot_1992>`_
80
136
  - `<https://www.myhora.com/ปฏิทิน/ปฏิทิน-พ.ศ.2475.aspx>`_
@@ -121,13 +177,8 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
121
177
  - This is only 100% accurate for 1997-2025; any future dates are up to the
122
178
  Royal Thai Government Gazette which updates on a year-by-year basis.
123
179
 
124
- - Approx. date only goes as far back as 1941 (B.E. 2484) as the Thai
125
- calendar for B.E. 2483 as we only have nine months from switching
126
- New Year Date (April 1st to January 1st).
127
-
128
- - Thai Lunar Calendar Holidays only work from 1941 (B.E. 2484) onwards
129
- until 2157 (B.E. 2700) as we only have Thai year-type data for
130
- cross-checking until then.
180
+ - Thai Lunar Calendar Holidays only work until 2157 (B.E. 2700) as we only
181
+ have Thai year-type data for cross-checking until then.
131
182
 
132
183
  - Royal Ploughing Ceremony Day is date is announced on an annual basis
133
184
  by the Court Astrologers, thus need an annual update to the library here
@@ -143,9 +194,8 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
143
194
  # %s (in lieu).
144
195
  observed_label = tr("ชดเชย%s")
145
196
  supported_languages = ("en_US", "th")
146
- # Due to Thai Calendar Migration, this is capped off at 1941.
147
- # But certain holidays were implemented before 1941.
148
- start_year = 1941
197
+ # First Holiday Decree was promulgated in March 1914.
198
+ start_year = 1914
149
199
 
150
200
  def __init__(self, *args, **kwargs):
151
201
  InternationalHolidays.__init__(self)
@@ -163,60 +213,110 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
163
213
  # วันขึ้นปีใหม่
164
214
  # Status: In-Use.
165
215
  # Starts in the present form in 1941 (B.E. 2484).
166
- # TODO: Add check for 1941 if we support earlier dates.
216
+ # From 1941-1945 and 1948-1954 JAN 2nd was also observed.
217
+ # For pre- observance, see New Year's Eve entry.
167
218
 
168
- # New Year's Day.
169
- self._add_observed(self._add_new_years_day(tr("วันขึ้นปีใหม่")))
219
+ if self._year >= 1941:
220
+ # New Year's Day.
221
+ name = tr("วันขึ้นปีใหม่")
222
+ self._add_observed(self._add_new_years_day(name))
223
+ if self._year <= 1945 or 1948 <= self._year <= 1954:
224
+ self._add_new_years_day_two(name)
170
225
 
171
226
  # วันเด็กแห่งชาติ
172
227
  # Status: In-Use.
173
- # Starts in 1955 as the 1st Monday of October.
228
+ # Starts in 1955 (B.E. 2498) as the 1st Monday of OCT.
229
+ # Its status as a Public Holiday was reaffirmed in 1956.
174
230
  # No event was held in 1964 due to date changes came into effect too late.
175
- # Moved to 2nd Saturday of January since 1965.
231
+ # Moved to 2nd Saturday of JAN since 1965.
176
232
  # No in-lieus are observed, and still remain a Public Holidays than just Observed.
177
233
 
178
234
  if self._year >= 1955 and self._year != 1964:
179
- # National Children's Day
180
- childrens_day = tr("วันเด็กแห่งชาติ")
235
+ # National Children's Day.
236
+ name = tr("วันเด็กแห่งชาติ")
181
237
  if self._year <= 1963:
182
- self._add_holiday_1st_mon_of_oct(childrens_day)
238
+ self._add_holiday_1st_mon_of_oct(name)
183
239
  else:
184
- self._add_holiday_2nd_sat_of_jan(childrens_day)
240
+ self._add_holiday_2nd_sat_of_jan(name)
185
241
 
186
- # วันจักรี
187
- # Status: In-Use.
188
- # Starts in present form in 1918 (B.E. 2461).
189
- # TODO: Add check for 1918 if we support earlier dates.
242
+ # วันลงนามในสัญญาพักรบระหว่างประเทศไทยกับประเทศอินโดจีนฝรั่งเศส
243
+ # Status: Defunct.
244
+ # Started in 1942 (B.E. 2485), abandoned from 1945 onwards.
190
245
 
191
- # Chakri Memorial Day.
192
- self._add_observed(self._add_holiday_apr_6(tr("วันจักรี")))
246
+ if 1942 <= self._year <= 1944:
247
+ # Franco-Thai War Armistice Day.
248
+ self._add_holiday_jan_28(tr("วันลงนามในสัญญาพักรบระหว่างประเทศไทยกับประเทศอินโดจีนฝรั่งเศส"))
193
249
 
194
- # วันสงกรานต์
250
+ # วันจักรี
251
+ # Status: In-Use.
252
+ # Starts in present form in 1926 (B.E. 2469).
253
+
254
+ if self._year >= 1926:
255
+ if self._year >= 1983:
256
+ # Chakri Memorial Day.
257
+ name = tr("วันพระบาทสมเด็จพระพุทธยอดฟ้าจุฬาโลกมหาราช และวันที่ระลึกมหาจักรีบรมราชวงศ์")
258
+ elif self._year >= 1938:
259
+ # Chakri Day.
260
+ name = tr("วันจักรี")
261
+ else:
262
+ # Maha Chakri Memorial Day.
263
+ name = tr("วันที่ระลึกมหาจักรี")
264
+ self._add_observed(self._add_holiday_apr_6(name))
265
+
266
+ # พระราชพิธีตะรุษะสงกรานต์ แลนักขัตฤกษ์ (1914-1925)
267
+ # ตะรุษะสงกรานต์ (1926-1937)
268
+ # วันตรุษสงกรานต์ (1938-1939)
269
+ # วันตรุษสงกรานต์และขึ้นปีใหม่ (1940)
270
+ # วันสงกรานต์ (1941-Present)
195
271
  # Status: In-Use.
196
- # Used to be April 1st as Thai New Year Day.
197
- # Initially abandoned in 1941 (B.E. 2484), declared again as
198
- # public holidays in 1948 (2491 B.E).
199
- # - 1948-1953, celebrated on Apr 13-15
200
- # - 1954-1956, abandoned as a public holiday
201
- # - 1957-1988, only celebrated on Apr 13
202
- # - 1989-1997, celebrated on Apr 12-14
203
- # - 1998-Present, celebrated on Apr 13-15
272
+ # Started in 1914 (B.E. 2457).
273
+ # Earliest form of Songkran public holidays was observed from MAR 28th to APR 15th
274
+ # (19 days). Later extended for MoJ staff only upto APR 27th from 1915 (30 days).
275
+ # - 1926-1937, celebrated on MAR 31st-APR 3rd.
276
+ # - 1938-1940, celebrated on MAR 31st-APR 2nd.
277
+ # - 1941-1947, abandoned as a public holiday.
278
+ # - 1948-1953, celebrated on APR 13th-15th.
279
+ # - 1954-1956, abandoned as a public holiday.
280
+ # - 1957-1988, only celebrated on APR 13th.
281
+ # - 1989-1997, celebrated on APR 12th-14th.
282
+ # - 1998-Present, celebrated on APR 13th-15th.
204
283
  # (Except for 2020 due to Covid-19 outbreaks)
205
284
  # This has its own in-lieu trigger.
206
285
 
207
- if 1948 <= self._year <= 1953 or 1957 <= self._year != 2020:
286
+ if self._year <= 1940 or 1948 <= self._year <= 1953 or 1957 <= self._year != 2020:
208
287
  # Songkran Festival.
209
- songkran_festival = tr("วันสงกรานต์")
210
- if 1957 <= self._year <= 1988:
211
- self._add_observed(self._add_holiday_apr_13(songkran_festival))
212
- elif 1989 <= self._year <= 1997:
213
- dt = self._add_holiday_apr_12(songkran_festival)
214
- self._add_holiday_apr_13(songkran_festival)
215
- self._add_holiday_apr_14(songkran_festival)
288
+ name = tr("วันสงกรานต์")
289
+ if 1989 <= self._year <= 1997:
290
+ dt = self._add_holiday_apr_12(name)
291
+ self._add_holiday_apr_13(name)
292
+ self._add_holiday_apr_14(name)
293
+ elif 1957 <= self._year <= 1988:
294
+ self._add_observed(self._add_holiday_apr_13(name))
295
+ elif 1926 <= self._year <= 1940:
296
+ if self._year == 1940:
297
+ # Songkran New Year.
298
+ name = tr("วันตรุษสงกรานต์และขึ้นปีใหม่")
299
+ elif self._year >= 1938:
300
+ # Songkran New Year.
301
+ name = tr("วันตรุษสงกรานต์")
302
+ else:
303
+ # Songkran New Year.
304
+ name = tr("ตะรุษะสงกรานต์")
305
+ self._add_holiday_mar_31(name)
306
+ self._add_holiday_apr_1(name)
307
+ self._add_holiday_apr_2(name)
308
+ if self._year <= 1937:
309
+ self._add_holiday_apr_3(name)
310
+ elif self._year <= 1925:
311
+ # Songkran New Year Holidays.
312
+ name = tr("พระราชพิธีตะรุษะสงกรานต์ แลนักขัตฤกษ์")
313
+ dt = self._add_holiday_mar_28(name)
314
+ for delta in range(1, 19):
315
+ self._add_holiday(name, _timedelta(dt, delta))
216
316
  else:
217
- dt = self._add_holiday_apr_13(songkran_festival)
218
- self._add_holiday_apr_14(songkran_festival)
219
- self._add_holiday_apr_15(songkran_festival)
317
+ dt = self._add_holiday_apr_13(name)
318
+ self._add_holiday_apr_14(name)
319
+ self._add_holiday_apr_15(name)
220
320
 
221
321
  # วันหยุดชดเชยวันสงกรานต์
222
322
  # If Songkran happened to be held on the weekends, only one in-lieu
@@ -241,32 +341,76 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
241
341
  # National Labor Day.
242
342
  self._add_observed(self._add_labor_day(tr("วันแรงงานแห่งชาติ")))
243
343
 
244
- # วันชาติ
344
+ # วันขอพระราชทานรัฐธรรมนูญ (1938-1939)
345
+ # วันชาติ (1940-Present)
245
346
  # Status: In-Use.
246
- # Starts in 1939 (B.E. 2482) by Plaek Phibunsongkhram.
247
- # Replaced by Rama IX's birthday in 1960 (B.E. 2503) by Sarit Thanarat.
248
- # TODO: Add check for 1939 if we support earlier dates.
249
-
250
- # National Day.
251
- national_day = tr("วันชาติ")
252
- self._add_observed(
253
- self._add_holiday_jun_24(national_day)
254
- if self._year <= 1959
255
- else self._add_holiday_dec_5(national_day)
256
- )
257
-
258
- # วันฉัตรมงคล
259
- # Starts in 1958 (B.E. 2501) for Rama IX's Coronation: May 5th.
260
- # No celebration in 2017-2019 (B.E 2560-2562).
261
- # Reestablished with Rama X's Coronation in 2020: May 4th.
262
-
263
- # Coronation Day.
264
- coronation_day = tr("วันฉัตรมงคล")
347
+ # Started as Constitution Petition Day in 1938 (B.E. 2481) for JUN 24th.
348
+ # Got its current name in 1940 by Plaek Phibunsongkhram.
349
+ # This was observed JUN 23th-25th between 1940-1948.
350
+ # Moved to Rama IX's birthday in 1960 (B.E. 2503) by Sarit Thanarat.
351
+
352
+ if self._year >= 1938:
353
+ name = (
354
+ # National Day.
355
+ tr("วันชาติ")
356
+ if self._year >= 1939
357
+ # Constitution Petition Day.
358
+ else tr("วันขอพระราชทานรัฐธรรมนูญ")
359
+ )
360
+ self._add_observed(
361
+ self._add_holiday_jun_24(name)
362
+ if self._year <= 1959
363
+ else self._add_holiday_dec_5(name)
364
+ )
365
+ if 1940 <= self._year <= 1948 or 1952 <= self._year <= 1953:
366
+ self._add_holiday_jun_23(name)
367
+ self._add_holiday_jun_25(name)
265
368
 
266
- if 1958 <= self._year <= 2016:
267
- self._add_observed(self._add_holiday_may_5(coronation_day))
268
- elif self._year >= 2020:
269
- self._add_observed(self._add_holiday_may_4(coronation_day))
369
+ # วันรัฐธรรมนูญชั่วคราว
370
+ # Status: Defunct.
371
+ # Started in 1938, abandoned in 1940.
372
+
373
+ if 1938 <= self._year <= 1939:
374
+ # Provisional Constitution Day.
375
+ self._add_holiday_jun_27(tr("วันรัฐธรรมนูญชั่วคราว"))
376
+
377
+ # ทำบุญพระบรมอัษฐิ และพระราชพิธีฉัตรมงคล (1914-1925)
378
+ # พระราชพิธีฉัตรมงคล (1926-1937)
379
+ # วันฉัตรมงคล (1958-Present)
380
+ # First observed for Rama VI from 1914-1925 from NOV 9th-12th.
381
+ # For Rama VII (1926-1935) this was FEB 24th-26th.
382
+ # After Rama VII abdicated on MAR 2nd, 1935, there's no recorded
383
+ # change in terms of holiday arrangement until 1938,
384
+ # thus, a gap in holidays arrangement is assumed.
385
+ # Rama VIII passes away without a coronation ceremony.
386
+ # Starts in 1958 (B.E. 2501) for Rama IX's Coronation: MAY 5th.
387
+ # No celebration in 2017-2019 (B.E. 2560-2562).
388
+ # Reestablished with Rama X's Coronation in 2020: MAY 4th.
389
+
390
+ if self._year <= 1935 or self._year >= 1958:
391
+ # Coronation Day.
392
+ name = tr("วันฉัตรมงคล")
393
+ if self._year >= 2020:
394
+ # Rama X (2020-Present).
395
+ self._add_observed(self._add_holiday_may_4(name))
396
+ elif 1958 <= self._year <= 2016:
397
+ # Rama IX (1958-2016).
398
+ self._add_observed(self._add_holiday_may_5(name))
399
+ elif 1926 <= self._year <= 1935:
400
+ # Coronation Day.
401
+ name = tr("พระราชพิธีฉัตรมงคล")
402
+ # Rama VII (1926-1935).
403
+ self._add_holiday_feb_24(name)
404
+ self._add_holiday_feb_25(name)
405
+ self._add_holiday_feb_26(name)
406
+ elif self._year <= 1925:
407
+ # Merit-making Ceremony for the Royal Ashes and the Coronation Day.
408
+ name = tr("ทำบุญพระบรมอัษฐิ และพระราชพิธีฉัตรมงคล")
409
+ # Rama VI (1914-1925).
410
+ self._add_holiday_nov_9(name)
411
+ self._add_holiday_nov_10(name)
412
+ self._add_holiday_nov_11(name)
413
+ self._add_holiday_nov_12(name)
270
414
 
271
415
  # วันเฉลิมพระชนมพรรษา พระราชินี
272
416
  # Status: In-Use.
@@ -282,7 +426,7 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
282
426
 
283
427
  # วันเฉลิมพระชนมพรรษา รัชกาลที่ 10
284
428
  # Status: In-Use.
285
- # Started in 2017 (B.E 2560).
429
+ # Started in 2017 (B.E. 2560).
286
430
 
287
431
  if self._year >= 2017:
288
432
  self._add_observed(
@@ -295,7 +439,7 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
295
439
  )
296
440
  )
297
441
 
298
- # วันเฉลิมพระชนมพรรษา พระบรมราชินีนาถ ( 1976-2017)
442
+ # วันเฉลิมพระชนมพรรษา พระบรมราชินีนาถ (1976-2017)
299
443
  # วันเฉลิมพระชนมพรรษา พระบรมราชชนนีพันปีหลวง (2017-Present)
300
444
  # Status: In-Use.
301
445
  # Started in 1976 (B.E. 2519) alongside Mother's Day.
@@ -303,90 +447,173 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
303
447
  # Now acts as the Queen Mother from 2017 onwards.
304
448
 
305
449
  if self._year >= 1976:
306
- q_sirikit_bday = (
307
- # HM Queen Sirikit the Queen Mother's Birthday.
308
- tr("วันเฉลิมพระชนมพรรษาสมเด็จพระบรมราชชนนีพันปีหลวง")
309
- if self._year >= 2017
310
- # HM Queen Sirikit's Birthday.
311
- else tr("วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสิริกิติ์ พระบรมราชินีนาถ")
450
+ self._add_observed(
451
+ self._add_holiday_aug_12(
452
+ # HM Queen Sirikit the Queen Mother's Birthday.
453
+ tr("วันเฉลิมพระชนมพรรษาสมเด็จพระบรมราชชนนีพันปีหลวง")
454
+ if self._year >= 2017
455
+ # HM Queen Sirikit's Birthday.
456
+ else tr("วันเฉลิมพระชนมพรรษาสมเด็จพระนางเจ้าสิริกิติ์ พระบรมราชินีนาถ")
457
+ )
312
458
  )
313
- self._add_observed(self._add_holiday_aug_12(q_sirikit_bday))
314
459
 
315
460
  # วันแม่แห่งชาติ
316
461
  # Status: In-Use.
317
- # Started 1950 (B.E 2493) initially as April 15 and cancelled in
318
- # 1958 (B.E 2501) when the Min. of Culture was abolished.
462
+ # Started 1950 (B.E. 2493) initially as APR 15th and cancelled in
463
+ # 1958 (B.E. 2501) when the Min. of Culture was abolished.
464
+ # Its status as a Public Holiday was reaffirmed in 1956.
319
465
  # Restarts again in 1976 (B.E. 2519) on Queen Sirikit's Birthday
320
- # (August 12) and stay that way from that point onwards.
466
+ # (AUG 12th) and stay that way from that point onwards.
321
467
 
322
468
  # National Mother's Day.
323
- thai_mothers_day = tr("วันแม่แห่งชาติ")
324
-
469
+ name = tr("วันแม่แห่งชาติ")
325
470
  if 1950 <= self._year <= 1957:
326
- self._add_observed(self._add_holiday_apr_15(thai_mothers_day))
471
+ self._add_observed(self._add_holiday_apr_15(name))
327
472
  elif self._year >= 1976:
328
- self._add_observed(self._add_holiday_aug_12(thai_mothers_day))
473
+ self._add_observed(self._add_holiday_aug_12(name))
474
+
475
+ # วันประกาศสันติภาพ
476
+ # Status: Defunct.
477
+ # Started in 1946 (B.E. 2489), removed in 1948.
329
478
 
330
- # วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทร มหาภูมิพลอดุลยเดช บรมนาถบพิตร
479
+ if 1946 <= self._year <= 1947:
480
+ # Peace Proclamation Day.
481
+ self._add_holiday_aug_16(tr("วันประกาศสันติภาพ"))
482
+
483
+ # วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร (2017-2018)
484
+ # วันคล้ายวันสวรรคตพระบาทสมเด็จพระบรมชนกาธิเบศร มหาภูมิพลอดุลยเดชมหาราช บรมนาถบพิตร (2019-2022)
485
+ # วันนวมินทรมหาราช (2023-Present)
331
486
  # Status: In-Use.
332
- # Started in 2017 (B.E 2560).
487
+ # Started in 2017 (B.E. 2560).
333
488
  # Got conferred with 'the Great' title in 2019 (B.E. 2562).
334
489
 
335
490
  if self._year >= 2017:
336
491
  if self._year >= 2023:
337
492
  # HM King Bhumibol Adulyadej Memorial Day.
338
- k_bhumibol_memorial = tr("วันนวมินทรมหาราช")
493
+ name = tr("วันนวมินทรมหาราช")
339
494
  elif self._year >= 2019:
340
495
  # Anniversary for the Death of King Bhumibol Adulyadej the Great.
341
- k_bhumibol_memorial = tr(
496
+ name = tr(
342
497
  "วันคล้ายวันสวรรคตพระบาทสมเด็จพระบรมชนกาธิเบศร มหาภูมิพลอดุลยเดชมหาราช บรมนาถบพิตร"
343
498
  )
344
499
  else:
345
500
  # Anniversary for the Death of King Bhumibol Adulyadej.
346
- k_bhumibol_memorial = tr(
347
- "วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร"
348
- )
349
- self._add_observed(self._add_holiday_oct_13(k_bhumibol_memorial))
501
+ name = tr("วันคล้ายวันสวรรคตพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร")
502
+ self._add_observed(self._add_holiday_oct_13(name))
350
503
 
351
- # วันปิยมหาราช
504
+ # ทำบุญพระบรมอัษฐิพระพุทธเจ้าหลวง (1914-1925)
505
+ # วันสวรรคตแห่งพระบาทสมเด็จพระพุทธเจ้าหลวง (1926-1937)
506
+ # วันปิยมหาราช (1946-Present)
352
507
  # Status: In-Use.
353
- # Started in 1911 (B.E. 2454).
354
- # TODO: Add check for 1911 if we support earlier dates.
355
-
356
- # HM King Chulalongkorn Memorial Day.
357
- self._add_observed(self._add_holiday_oct_23(tr("วันปิยมหาราช")))
508
+ # Started in 1914 (B.E. 2457).
509
+ # Was abandoned between 1938-1945.
510
+
511
+ if self._year <= 1937 or self._year >= 1946:
512
+ if self._year >= 1946:
513
+ # HM King Chulalongkorn Memorial Day.
514
+ name = tr("วันปิยมหาราช")
515
+ elif self._year >= 1926:
516
+ # Anniversary for the Death of HM King Chulalongkorn.
517
+ name = tr("วันสวรรคตแห่งพระบาทสมเด็จพระพุทธเจ้าหลวง")
518
+ else:
519
+ # Merit-making Ceremony for the Royal Ashes of HM King Chulalongkorn.
520
+ name = tr("ทำบุญพระบรมอัษฐิพระพุทธเจ้าหลวง")
521
+ self._add_observed(self._add_holiday_oct_23(name))
358
522
 
523
+ # วันสหประชาชาติ
524
+ # Status: Defunct.
525
+ # Added since 1951 (B.E. 2494), removed in 1957.
526
+ # Technically removed in 1954, but was re-added soon after.
527
+
528
+ if 1951 <= self._year <= 1956:
529
+ # United Nations Day.
530
+ self._add_united_nations_day(tr("วันสหประชาชาติ"))
531
+
532
+ # เฉลิมพระชนมพรรษา (1914-1925)
533
+ # เฉลิมพระชนม์พรรษา (1926-1937)
534
+ # วันเฉลิมพระชนม์พรรษา (1938-1940)
535
+ # วันเกิดในสมเด็จพระเจ้าอยู่หัว (1941-1944)**
536
+ # วันเฉลิมพระชนมพรรษา (1945-1959)
359
537
  # วันเฉลิมพระชนมพรรษา รัชกาลที่ 9 (1960-2016)
360
538
  # วันคล้ายวันเฉลิมพระชนมพรรษา รัชกาลที่ 9 (2017-Present)
361
539
  # Status: In-Use.
362
- # Replaced Nataion Day (26 June) in 1960 (B.E. 2503) by Sarit Thanarat.
363
- # Confirmed as still in-use in 2017.
364
- # Got conferred with 'the Great' title in 2019 (B.E. 2562).
540
+ # Rama VI's Birthday was observed from DEC 30th-JAN 3rd between 1914-1925.
541
+ # Rama VII's Birthday was observed from NOV 7th-9th between 1926-1934.
542
+ # After Rama VII abdicated on MAR 2nd, 1935, there's no recorded
543
+ # change in terms of holiday arrangement until 1938,
544
+ # thus, a gap in holidays arrangement is assumed.
545
+ # Rama VIII's Birthday was observed on SEP 20th between 1938-1945.
546
+ # Between 1940-1945 the 2nd day (SEP 21st) was also observed as well.
547
+ # Rama IX's Birthday was observed from 1946-Present.
548
+ # Between 1946-1953 DEC 6th was also observed. From 1948 onwards DEC 4th
549
+ # was observed too except in 1951 when it was temporarily moved to DEC 7th.
550
+ # Replaced National Day (JUN 26th) in 1960 (B.E. 2503) by Sarit Thanarat.
551
+ # Confirmed as still in-use as Rama IX's in 2017.
552
+ # Rama IX got conferred with 'the Great' title in 2019 (B.E. 2562).
553
+ # For historical purpose, 1926-1940 entry uses the old spelling.
554
+ # **Official naming was override by "Birthday Name Decree" between 1941-1944.
365
555
 
366
- if self._year >= 1960:
367
- if self._year >= 2019:
368
- k_bhumibol_bday = (
369
- # HM King Bhumibol Adulyadej's the Great's Birthday Anniversary.
370
- tr(
371
- "วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระบรม"
372
- "ชนกาธิเบศร มหาภูมิพลอดุลยเดชมหาราช บรมนาถบพิตร"
373
- )
374
- )
375
- elif self._year >= 2016:
376
- k_bhumibol_bday = (
377
- # HM King Bhumibol Adulyadej Birthday Anniversary.
378
- tr("วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร")
379
- )
380
- else:
381
- k_bhumibol_bday = (
382
- # HM King Bhumibol Adulyadej Birthday Anniversary.
383
- tr("วันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร")
384
- )
385
- self._add_observed(self._add_holiday_dec_5(k_bhumibol_bday))
556
+ if self._year >= 2019:
557
+ # HM King Bhumibol Adulyadej the Great's Birthday Anniversary.
558
+ name = tr(
559
+ "วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระบรมชนกาธิเบศร "
560
+ "มหาภูมิพลอดุลยเดชมหาราช บรมนาถบพิตร"
561
+ )
562
+ elif self._year >= 2016:
563
+ # HM King Bhumibol Adulyadej Birthday Anniversary.
564
+ name = tr("วันคล้ายวันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร")
565
+ elif self._year >= 1960:
566
+ # HM King Bhumibol Adulyadej Birthday Anniversary.
567
+ name = tr("วันเฉลิมพระชนมพรรษาพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช บรมนาถบพิตร")
568
+ elif self._year >= 1945:
569
+ # The King's Birthday.
570
+ name = tr("วันเฉลิมพระชนมพรรษา")
571
+ elif self._year >= 1941:
572
+ # The King's Birthday.
573
+ name = tr("วันเกิดในสมเด็จพระเจ้าอยู่หัว")
574
+ elif self._year >= 1938:
575
+ # The King's Birthday.
576
+ name = tr("วันเฉลิมพระชนม์พรรษา")
577
+ elif self._year >= 1926:
578
+ # The King's Birthday.
579
+ name = tr("เฉลิมพระชนม์พรรษา")
580
+ else:
581
+ # The King's Birthday.
582
+ name = tr("เฉลิมพระชนมพรรษา")
583
+
584
+ if self._year >= 1946:
585
+ # Rama IX (1946-2016; In Memoriam 2017-Present).
586
+ self._add_observed(self._add_holiday_dec_5(name))
587
+ if self._year <= 1953:
588
+ self._add_holiday_dec_6(name)
589
+ if self._year == 1951:
590
+ self._add_holiday_dec_7(name)
591
+ elif self._year >= 1948:
592
+ self._add_holiday_dec_4(name)
593
+ elif self._year >= 1938:
594
+ # Rama VIII (1938*-1945).
595
+ # *There was no decree confirming his holiday until 1938.
596
+ self._add_holiday_sep_20(name)
597
+ if self._year >= 1940:
598
+ self._add_holiday_sep_21(name)
599
+ elif 1926 <= self._year <= 1934:
600
+ # Rama VII (1926-1934).
601
+ self._add_holiday_nov_7(name)
602
+ self._add_holiday_nov_8(name)
603
+ self._add_holiday_nov_9(name)
604
+ elif self._year <= 1925:
605
+ # Rama VI (1914-1925).
606
+ if self._year <= 1924:
607
+ self._add_holiday_dec_30(name)
608
+ self._add_holiday_dec_31(name)
609
+ if self._year >= 1915:
610
+ self._add_holiday_jan_1(name)
611
+ self._add_holiday_jan_2(name)
612
+ self._add_holiday_jan_3(name)
386
613
 
387
614
  # วันพ่อแห่งชาติ
388
615
  # Status: In-Use.
389
- # Starts in 1980 (B.E 2523).
616
+ # Starts in 1980 (B.E. 2523).
390
617
  # Technically, a replication of HM King Bhumibol Adulyadej's Birthday
391
618
  # but it's in the official calendar, so may as well have this here.
392
619
 
@@ -396,92 +623,147 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
396
623
 
397
624
  # วันรัฐธรรมนูญ
398
625
  # Status: In-Use.
399
- # Presumed to starts in 1932 (B.E. 2475).
400
- # Last known official record is Bank of Thailand's in 1992 (B.E. 2535).
401
- # TODO: Add check for 1932 if we support earlier dates.
402
-
403
- # Constitution Day.
404
- self._add_observed(self._add_holiday_dec_10(tr("วันรัฐธรรมนูญ")))
626
+ # Starts in 1938 (B.E. 2481).
627
+ # Initially as DEC 9th-11th, got trimmed down to DEC 10th in 1947.
628
+ # Readded Pre- and Post- holidays in 1950 before removed again in 1954.
629
+
630
+ if self._year >= 1938:
631
+ # Constitution Day.
632
+ name = tr("วันรัฐธรรมนูญ")
633
+ self._add_observed(self._add_holiday_dec_10(name))
634
+ if self._year <= 1947 or 1950 <= self._year <= 1953:
635
+ self._add_holiday_dec_9(name)
636
+ self._add_holiday_dec_11(name)
405
637
 
406
638
  # วันสิ้นปี
407
639
  # Status: In-Use.
408
- # Presumed to start in the present form in 1941 (B.E. 2484).
409
- # Last known official record is Bank of Thailand's in 1992 (B.E. 2535).
410
- # TODO: Add check for 1941 if we support earlier dates.
640
+ # Started in 1941 (B.E. 2484; as part of New Year Holidays)
641
+ # Abandoned in 1957, presumed to restart in 1989.
411
642
  # This has its own in-lieu trigger.
412
643
 
413
- # New Year's Eve.
414
- name = tr("วันสิ้นปี")
415
- self._add_new_years_eve(name)
644
+ if 1941 <= self._year <= 1956 or self._year >= 1989:
645
+ # New Year's Eve.
646
+ name = tr("วันสิ้นปี")
647
+ self._add_new_years_eve(name)
416
648
 
417
- # วันหยุดชดเชยวันสิ้นปี
418
- # Status: In-Use.
419
- # Added separately from New Year's Eve itself so that it would't
420
- # go over the next year.
421
- # - CASE 1: SAT-SUN -> 1 in-lieu on TUE.
422
- # - CASE 2: SUN-MON -> 1 in-lieu on TUE.
423
- # See in lieu logic in `_add_observed(dt: date)`.
649
+ # วันหยุดชดเชยวันสิ้นปี
650
+ # Status: In-Use.
651
+ # Added separately from New Year's Eve itself so that it would't
652
+ # go over the next year.
653
+ # - CASE 1: SAT-SUN -> 1 in-lieu on TUE.
654
+ # - CASE 2: SUN-MON -> 1 in-lieu on TUE.
655
+ # See in lieu logic in `_add_observed(dt: date)`.
424
656
 
425
- if self._year >= 1995 and self._year != 2024:
426
- self._add_observed(date(self._year - 1, DEC, 31), name=name, rule=SAT_SUN_TO_NEXT_TUE)
657
+ if self._year >= 1995 and self._year != 2024:
658
+ self._add_observed(
659
+ date(self._year - 1, DEC, 31), name=name, rule=SAT_SUN_TO_NEXT_TUE
660
+ )
427
661
 
428
662
  # Thai Lunar Calendar Holidays
429
663
  # See `_ThaiLunisolar` in holidays/utils.py for more details.
430
- # Thai Lunar Calendar Holidays only work from 1941 to 2057.
431
664
 
432
665
  # วันมาฆบูชา
433
666
  # Status: In-Use.
434
-
435
- # Makha Bucha.
436
- self._add_observed(self._add_makha_bucha(tr("วันมาฆบูชา")))
667
+ # Started in 1915 (B.E. 2457**), not observed between 1926-1937.
668
+ # For historical purpose, pre-1925 entry uses the old spelling.
669
+ # **For pre-1941 data, Buddhist Era year starts on APR 1st.
670
+
671
+ if 1915 <= self._year <= 1925 or self._year >= 1938:
672
+ name = (
673
+ # Makha Bucha.
674
+ tr("วันมาฆบูชา")
675
+ if self._year >= 1938
676
+ # Makha Bucha, the Fourfold Assembly Day.
677
+ else tr("มาฆบูชา จาตุรงฅ์สันนิบาต")
678
+ )
679
+ self._add_observed(self._add_makha_bucha(name))
437
680
 
438
681
  # วันวิสาขบูชา
439
682
  # Status: In-Use.
683
+ # Started in 1914 (B.E. 2457) with pre- and post- observance.
684
+ # From 1938-1953 only post- is added.
685
+ # For historical purpose, pre-1957 entry uses the old spelling.
686
+ # Note that the ones during Rama VII era uses ศ instead of ส.
440
687
 
441
- # Visakha Bucha.
442
- self._add_observed(self._add_visakha_bucha(tr("วันวิสาขบูชา")))
443
-
444
- # วันอาสาฬหบูชา
688
+ if self._year >= 1957:
689
+ # Visakha Bucha.
690
+ name = tr("วันวิสาขบูชา")
691
+ elif self._year >= 1938:
692
+ # Visakha Bucha.
693
+ name = tr("วันวิสาขะบูชา")
694
+ elif self._year >= 1926:
695
+ # Visakha Bucha.
696
+ name = tr("วิศาขะบูชา")
697
+ else:
698
+ # Visakha Bucha.
699
+ name = tr("วิสาขะบูชา")
700
+
701
+ dt = self._add_visakha_bucha(name)
702
+ if self._year <= 1953:
703
+ self._add_holiday(name, _timedelta(dt, +1))
704
+ if self._year <= 1937:
705
+ self._add_holiday(name, _timedelta(dt, -1))
706
+ else:
707
+ self._add_observed(dt)
708
+
709
+ # วันเข้าพรรษา-วันอาสาฬหบูชา
445
710
  # Status: In-Use.
711
+ # - Started in 1914 (B.E. 2457) with Asarnha Bucha and pre-Asarnha Bucha observance.
712
+ # - From 1938-1953 only Asarnha Bucha is added.
713
+ # - 2nd, 3rd, 4th, and 5th day was also observed pre-1926.
714
+ # - Asarnha Bucha was re-added with its own name from 1962 onwards.
715
+ # For historical purpose, pre-1938 entry uses the old spelling.
716
+ # When used in combo with Asarnha Bucha Day.
446
717
  # - CASE 1: FRI-SAT -> 1 in-lieu on MON
447
718
  # - CASE 2: SAT-SUN -> 1 in-lieu on MON
448
719
  # - CASE 3: SUN-MON -> 1 in-lieu on TUE
449
720
 
450
- self._add_observed(
451
- # Asarnha Bucha.
452
- self._add_asarnha_bucha(tr("วันอาสาฬหบูชา")),
453
- rule=SAT_SUN_TO_NEXT_MON_TUE,
721
+ name = (
722
+ # Buddhist Lent Day.
723
+ tr("วันเข้าพรรษา")
724
+ if self._year >= 1938
725
+ # Buddhist Lent Day.
726
+ else tr("เข้าปุริมพรรษา")
454
727
  )
455
-
456
- # วันเข้าพรรษา
457
- # Status: In-Use.
458
- # - CASE 1: FRI-SAT -> 1 in-lieu on MON
459
- # - CASE 2: SAT-SUN -> 1 in-lieu on MON
460
- # - CASE 3: SUN-MON -> 1 in-lieu on TUE
461
-
462
- # Buddhist Lent Day.
463
- self._add_observed(self._add_khao_phansa(tr("วันเข้าพรรษา")), rule=SAT_TO_NEXT_MON)
728
+ dt = self._add_khao_phansa(name)
729
+ if self._year <= 1953:
730
+ self._add_asarnha_bucha(name)
731
+ if self._year <= 1937:
732
+ self._add_holiday(name, _timedelta(dt, -2))
733
+ if self._year <= 1925:
734
+ self._add_holiday(name, _timedelta(dt, +1))
735
+ self._add_holiday(name, _timedelta(dt, +2))
736
+ self._add_holiday(name, _timedelta(dt, +3))
737
+ self._add_holiday(name, _timedelta(dt, +4))
738
+ else:
739
+ self._add_observed(dt, rule=SAT_TO_NEXT_MON)
740
+ if self._year >= 1962:
741
+ self._add_observed(
742
+ # Asarnha Bucha.
743
+ self._add_asarnha_bucha(tr("วันอาสาฬหบูชา")),
744
+ rule=SAT_SUN_TO_NEXT_MON_TUE,
745
+ )
464
746
 
465
747
  def _populate_armed_forces_holidays(self):
466
748
  # วันกองทัพไทย
467
749
  # Status: In-Use.
468
- # First started in 1959 on the foundation of Ministry of Defense Day (APR 8).
469
- # Moved to JAN 25 (Supposedly King Naresuan's Decisive Battle) in 1980.
470
- # Corrected to the battle's actual date (JAN 18) in 2007.
750
+ # First started in 1959 (B.E. 2502) on the Ministry of Defense Foundation Day (APR 8th).
751
+ # Moved to JAN 25th (Supposedly King Naresuan's Decisive Battle) in 1980.
752
+ # Corrected to the battle's actual date (JAN 18th) in 2007.
471
753
  # Only applys to members of the Royal Thai Armed Forces.
472
754
 
473
755
  if self._year >= 1959:
474
- # Royal Thai Armed Forces Day
475
- armed_forces_day = tr("วันกองทัพไทย")
756
+ # Royal Thai Armed Forces Day.
757
+ name = tr("วันกองทัพไทย")
476
758
  if self._year >= 2007:
477
- self._add_holiday_jan_18(armed_forces_day)
759
+ self._add_holiday_jan_18(name)
478
760
  elif self._year >= 1980:
479
- self._add_holiday_jan_25(armed_forces_day)
761
+ self._add_holiday_jan_25(name)
480
762
  else:
481
- self._add_holiday_apr_8(armed_forces_day)
763
+ self._add_holiday_apr_8(name)
482
764
 
483
765
  def _populate_bank_holidays(self):
484
- # Bank of Thailand, the ones who decreed this wasn't found until December 10, 1942
766
+ # Bank of Thailand, the ones who decreed this wasn't found until DEC 10th, 1942.
485
767
  # So it's safe to assume with that as our start date.
486
768
  if self._year <= 1942:
487
769
  return None
@@ -495,8 +777,8 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
495
777
 
496
778
  if self._year <= 2021:
497
779
  self._add_holiday_apr_1(
498
- # Additional Closing Day for Bank for Agriculture and Agricultural Cooperatives
499
- tr("วันหยุดเพิ่มเติมสำหรับการปิดบัญชีประจำปีของธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร"),
780
+ # Additional Closing Day for Bank for Agriculture and Agricultural Cooperatives.
781
+ tr("วันหยุดเพิ่มเติมสำหรับการปิดบัญชีประจำปีของธนาคารเพื่อการเกษตรและสหกรณ์การเกษตร")
500
782
  )
501
783
 
502
784
  # วันหยุดภาคครึ่งปีของสถาบันการเงินและสถาบันการเงินเฉพาะกิจ
@@ -505,16 +787,16 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
505
787
  # Abandoned in 2019.
506
788
 
507
789
  if self._year <= 2018:
508
- self._add_holiday_jul_1(
509
- # Mid-Year Closing Day
510
- tr("วันหยุดภาคครึ่งปีของสถาบันการเงินและสถาบันการเงินเฉพาะกิจ"),
511
- )
790
+ # Mid-Year Closing Day.
791
+ self._add_holiday_jul_1(tr("วันหยุดภาคครึ่งปีของสถาบันการเงินและสถาบันการเงินเฉพาะกิจ"))
512
792
 
513
793
  def _populate_government_holidays(self):
514
794
  # No Future Fixed Date Holidays
515
795
 
516
796
  # วันพืชมงคล
517
- # Restarts in 1947 (B.E. 2490), wouldn't become an holiday again until 1960 (B.E. 2503).
797
+ # Restarts in 1947 (B.E. 2490), become holiday again since 1952
798
+ # but since we lacked the exact date records, this will be ignored.
799
+ # Become an holiday again until 1960 (B.E. 2503).
518
800
  # Removed as an holiday in 1999 due to financial crisis, reinstated in 2000.
519
801
  # No event was held in 2021 due to local Covid-19 situation, though it stays a day off.
520
802
  # Is dated on an annual basis by the Royal Palace, always on weekdays.
@@ -522,7 +804,7 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
522
804
  # this from 1966 onwards. For earlier records the date was refered as วันแรกนาขวัญ.
523
805
  # This isn't even fixed even by the Thai Lunar Calendar besides being in Month 6
524
806
  # to concides with the rainy season, but instead by Court Astrologers; All chosen dates
525
- # so far are all in the first three weeks of May.
807
+ # so far are all in the first three weeks of MAY.
526
808
  # *** NOTE: only observed by government sectors.
527
809
  # TODO: Update this annually around Dec of each year.
528
810
 
@@ -608,7 +890,7 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
608
890
  # Only applies to Ministry of Education (Students, Teachers, etc.), no in-lieus are given.
609
891
 
610
892
  if self._year >= 1957:
611
- # Teacher's Day
893
+ # Teacher's Day.
612
894
  self._add_holiday_jan_16(tr("วันครู"))
613
895
 
614
896
  def _populate_workday_holidays(self):
@@ -620,7 +902,7 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
620
902
  # Status: In-Use.
621
903
  # Started in 1948.
622
904
 
623
- # Thai Veterans Day
905
+ # Thai Veterans Day.
624
906
  self._add_holiday_feb_3(tr("วันทหารผ่านศึก"))
625
907
 
626
908
  if self._year >= 1982:
@@ -628,7 +910,7 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
628
910
  # Status: In-Use.
629
911
  # Started in 1982.
630
912
 
631
- # National Science Day
913
+ # National Science Day.
632
914
  self._add_holiday_aug_18(tr("วันวิทยาศาสตร์แห่งชาติ"))
633
915
 
634
916
  if self._year >= 1985:
@@ -636,7 +918,7 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
636
918
  # Status: In-Use.
637
919
  # Started in 1985.
638
920
 
639
- # National Artist Day
921
+ # National Artist Day.
640
922
  self._add_holiday_feb_26(tr("วันศิลปินแห่งชาติ"))
641
923
 
642
924
  if self._year >= 1989:
@@ -644,7 +926,7 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
644
926
  # Status: In-Use.
645
927
  # Started in 1989.
646
928
 
647
- # International Women's Day
929
+ # International Women's Day.
648
930
  self._add_womens_day(tr("วันสตรีสากล"))
649
931
 
650
932
  if self._year >= 1990:
@@ -652,14 +934,14 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
652
934
  # Status: In-Use.
653
935
  # Started in 1990.
654
936
 
655
- # National Forest Conservation Day
937
+ # National Forest Conservation Day.
656
938
  self._add_holiday_jan_14(tr("วันอนุรักษ์ทรัพยากรป่าไม้ของชาติ"))
657
939
 
658
940
  # วันพ่อขุนรามคำแหงมหาราช
659
941
  # Status: In-Use.
660
942
  # Started in 1990.
661
943
 
662
- # HM King Ramkamhaeng Memorial Day
944
+ # HM King Ramkamhaeng Memorial Day.
663
945
  self._add_holiday_jan_17(tr("วันพ่อขุนรามคำแหงมหาราช"))
664
946
 
665
947
  if self._year >= 1995:
@@ -667,7 +949,7 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
667
949
  # Status: In-Use.
668
950
  # Started in 1995.
669
951
 
670
- # National Aviation Day
952
+ # National Aviation Day.
671
953
  self._add_holiday_jan_13(tr("วันการบินแห่งชาติ"))
672
954
 
673
955
  if self._year >= 2017:
@@ -675,14 +957,14 @@ class Thailand(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiC
675
957
  # Status: In-Use.
676
958
  # Started in 2017.
677
959
 
678
- # Thai National Flag Day
960
+ # Thai National Flag Day.
679
961
  self._add_holiday_sep_28(tr("วันพระราชทานธงชาติไทย"))
680
962
 
681
963
  # วันลอยกระทง
682
964
  # Status: In-Use.
683
- # Started in 1941.
965
+ # Started in 1914.
684
966
 
685
- # Loy Krathong
967
+ # Loy Krathong.
686
968
  self._add_loy_krathong(tr("วันลอยกระทง"))
687
969
 
688
970
 
@@ -695,7 +977,12 @@ class THA(Thailand):
695
977
 
696
978
 
697
979
  class ThailandStaticHolidays:
698
- # วันหยุดพิเศษ (เพิ่มเติม) - see Bank of Thailand's DB for Cross-Check.
980
+ """
981
+ วันหยุดพิเศษ (เพิ่มเติม) - see Bank of Thailand's DB for Cross-Check.
982
+
983
+ Special Bank Holidays Pre-1992:
984
+ - `HM Queen Rambai Barni's Royal Cremation Ceremony. <https://ratchakitcha.soc.go.th/documents/1560949.pdf>`_
985
+ """
699
986
 
700
987
  # Special In Lieu Holiday.
701
988
  thai_special_in_lieu_holidays = tr("วันหยุดชดเชย")
@@ -706,27 +993,24 @@ class ThailandStaticHolidays:
706
993
 
707
994
  # Special Cases.
708
995
 
709
- # HM King Bhumibol Adulyadej's Golden Jubilee.
710
- rama_ix_golden_jubilee = tr("พระราชพิธีกาญจนาภิเษก พ.ศ. 2539")
711
996
  # HM King Bhumibol Adulyadej's 60th Anniversary of Accession Event.
712
997
  rama_ix_sixty_accession = tr("พระราชพิธีฉลองสิริราชสมบัติครบ 60 ปี พ.ศ. 2549")
713
- # Emergency Lockdown (Thai Military Coup d'état).
714
- thai_military_emergency_lockdown = tr("วันหยุดพิเศษ (คมช.)")
715
998
  # Emergency Lockdown (Thai Political Unrest).
716
999
  thai_political_emergency_lockdown = tr("วันหยุดพิเศษ (การเมือง)")
717
1000
  # Emergency Lockdown (2011 Thailand Floods).
718
1001
  thai_flood_2011_emergency_lockdown = tr("วันหยุดพิเศษ (มหาอุทกภัย พ.ศ. 2554)")
719
- # Day of Mourning for HM King Bhumibol Adulyadej.
720
- rama_ix_mourning = tr("วันหยุดพิเศษ (ร่วมถวายอาลัย ส่งดวงพระวิญญาณพระบรมศพ)")
721
- # HM King Bhumibol Adulyadej's Royal Cremation Ceremony.
722
- rama_ix_cremation = tr("วันพระราชพิธีถวายพระเพลิงพระบรมศพพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช")
723
- # HM King Maha Vajiralongkorn's Coronation Celebrations.
724
- rama_x_coronation_celebrations = tr("พระราชพิธีบรมราชาภิเษก พระบาทสมเด็จพระวชิรเกล้าเจ้าอยู่หัว")
725
1002
  # Songkran Festival.
726
1003
  songkran_festival = tr("วันสงกรานต์")
727
1004
 
1005
+ special_bank_holidays = {
1006
+ # HM Queen Rambai Barni's Royal Cremation Ceremony.
1007
+ 1985: (APR, 9, tr("วันพระราชพิธีถวายพระเพลิงพระบรมศพสมเด็จพระนางเจ้ารำไพพรรณี"))
1008
+ }
728
1009
  special_public_holidays = {
729
1010
  # 1992-1994 (include In Lieus, Checked with Bank of Thailand Data).
1011
+ # 1995-1997 (Bank of Thailand Data).
1012
+ # 1998-2000 (include In Lieus, Checked with Bank of Thailand Data).
1013
+ # From 2001 Onwards (Checked with Bank of Thailand Data).
730
1014
  1992: (
731
1015
  (MAY, 18, thai_special_in_lieu_holidays),
732
1016
  (DEC, 7, thai_special_in_lieu_holidays),
@@ -744,9 +1028,8 @@ class ThailandStaticHolidays:
744
1028
  (OCT, 24, thai_special_in_lieu_holidays),
745
1029
  (DEC, 12, thai_special_in_lieu_holidays),
746
1030
  ),
747
- # 1995-1997 (Bank of Thailand Data).
748
- 1996: (JUN, 10, rama_ix_golden_jubilee),
749
- # 1998-2000 (include In Lieus, Checked with Bank of Thailand Data).
1031
+ # HM King Bhumibol Adulyadej's Golden Jubilee.
1032
+ 1996: (JUN, 10, tr("พระราชพิธีกาญจนาภิเษก พ.ศ. 2539")),
750
1033
  1998: (
751
1034
  (MAY, 11, thai_special_in_lieu_holidays),
752
1035
  (DEC, 7, thai_special_in_lieu_holidays),
@@ -764,13 +1047,13 @@ class ThailandStaticHolidays:
764
1047
  (DEC, 11, thai_special_in_lieu_holidays),
765
1048
  (DEC, 29, thai_election),
766
1049
  ),
767
- # From 2001 Onwards (Checked with Bank of Thailand Data).
768
1050
  2006: (
769
1051
  (APR, 19, thai_election),
770
1052
  (JUN, 9, rama_ix_sixty_accession),
771
1053
  (JUN, 12, rama_ix_sixty_accession),
772
1054
  (JUN, 13, rama_ix_sixty_accession),
773
- (SEP, 20, thai_military_emergency_lockdown),
1055
+ # Emergency Lockdown (Thai Military Coup d'état).
1056
+ (SEP, 20, tr("วันหยุดพิเศษ (คมช.)")),
774
1057
  ),
775
1058
  2009: (
776
1059
  (JAN, 2, thai_bridge_public_holiday),
@@ -802,10 +1085,13 @@ class ThailandStaticHolidays:
802
1085
  2016: (
803
1086
  (MAY, 6, thai_bridge_public_holiday),
804
1087
  (JUL, 18, thai_bridge_public_holiday),
805
- (OCT, 14, rama_ix_mourning),
1088
+ # Day of Mourning for HM King Bhumibol Adulyadej.
1089
+ (OCT, 14, tr("วันหยุดพิเศษ (ร่วมถวายอาลัย ส่งดวงพระวิญญาณพระบรมศพ)")),
806
1090
  ),
807
- 2017: (OCT, 26, rama_ix_cremation),
808
- 2019: (MAY, 6, rama_x_coronation_celebrations),
1091
+ # HM King Bhumibol Adulyadej's Royal Cremation Ceremony.
1092
+ 2017: (OCT, 26, tr("วันพระราชพิธีถวายพระเพลิงพระบรมศพพระบาทสมเด็จพระปรมินทรมหาภูมิพลอดุลยเดช")),
1093
+ # HM King Maha Vajiralongkorn's Coronation Celebrations.
1094
+ 2019: (MAY, 6, tr("พระราชพิธีบรมราชาภิเษก พระบาทสมเด็จพระวชิรเกล้าเจ้าอยู่หัว")),
809
1095
  2020: (
810
1096
  (NOV, 19, thai_bridge_public_holiday),
811
1097
  (NOV, 20, thai_bridge_public_holiday),