Skip to content

Commit

Permalink
Update Cambodian holidays for 2024 (#1936)
Browse files Browse the repository at this point in the history
  • Loading branch information
PPsyrius authored Aug 20, 2024
1 parent d2f28bc commit 17e3780
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
23 changes: 20 additions & 3 deletions holidays/countries/cambodia.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from gettext import gettext as tr

from holidays.calendars.gregorian import MAY, AUG, SEP, _timedelta
from holidays.calendars.gregorian import APR, MAY, AUG, SEP, _timedelta
from holidays.calendars.thai import KHMER_CALENDAR
from holidays.groups import InternationalHolidays, StaticHolidays, ThaiCalendarHolidays
from holidays.holiday_base import HolidayBase
Expand Down Expand Up @@ -86,12 +86,25 @@ def _populate_public_holidays(self):

# ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ
# Status: In-Use.
# Usually falls on April 13th except for 2017-2018 and 2021-2023 for years 2001-2050.
# Usually falls on April 13th except for 2017-2018, 2021-2023, 2025-2027, 2029-2031
# for years 2001-2050.

if self._year != 2020:
# Khmer New Year's Day
sangkranta = tr("ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ")
sangkranta_years_apr_14 = {2017, 2018, 2021, 2022, 2023}
sangkranta_years_apr_14 = {
2017,
2018,
2021,
2022,
2023,
2025,
2026,
2027,
2029,
2030,
2031,
}
dt = (
self._add_holiday_apr_14(sangkranta)
if self._year in sangkranta_years_apr_14
Expand Down Expand Up @@ -284,6 +297,9 @@ class CambodiaStaticHolidays:
# Special Public Holiday
special_in_lieu_holidays = tr("ថ្ងៃឈប់សម្រាកសងជំនួស")

# Khmer New Year's Day
sangkranta = tr("ពិធីបុណ្យចូលឆ្នាំថ្មីប្រពៃណីជាតិ")

special_public_holidays = {
2016: (
(MAY, 2, special_in_lieu_holidays),
Expand All @@ -299,4 +315,5 @@ class CambodiaStaticHolidays:
(AUG, 20, sangkranta_in_lieu_covid),
(AUG, 21, sangkranta_in_lieu_covid),
),
2024: (APR, 16, sangkranta),
}
13 changes: 7 additions & 6 deletions snapshots/countries/KH_COMMON.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@
"2024-04-13": "Khmer New Year's Day",
"2024-04-14": "Khmer New Year's Day",
"2024-04-15": "Khmer New Year's Day",
"2024-04-16": "Khmer New Year's Day",
"2024-05-01": "International Labor Day",
"2024-05-14": "HM King Norodom Sihamoni's Birthday",
"2024-05-22": "Visaka Bochea Day",
Expand All @@ -742,9 +743,9 @@
"2025-01-01": "International New Year Day",
"2025-01-07": "Day of Victory over the Genocidal Regime",
"2025-03-08": "International Women's Rights Day",
"2025-04-13": "Khmer New Year's Day",
"2025-04-14": "Khmer New Year's Day",
"2025-04-15": "Khmer New Year's Day",
"2025-04-16": "Khmer New Year's Day",
"2025-05-01": "International Labor Day",
"2025-05-11": "Visaka Bochea Day",
"2025-05-14": "HM King Norodom Sihamoni's Birthday",
Expand All @@ -763,9 +764,9 @@
"2026-01-01": "International New Year Day",
"2026-01-07": "Day of Victory over the Genocidal Regime",
"2026-03-08": "International Women's Rights Day",
"2026-04-13": "Khmer New Year's Day",
"2026-04-14": "Khmer New Year's Day",
"2026-04-15": "Khmer New Year's Day",
"2026-04-16": "Khmer New Year's Day",
"2026-05-01": "International Labor Day; Visaka Bochea Day",
"2026-05-05": "Royal Ploughing Ceremony",
"2026-05-14": "HM King Norodom Sihamoni's Birthday",
Expand All @@ -783,9 +784,9 @@
"2027-01-01": "International New Year Day",
"2027-01-07": "Day of Victory over the Genocidal Regime",
"2027-03-08": "International Women's Rights Day",
"2027-04-13": "Khmer New Year's Day",
"2027-04-14": "Khmer New Year's Day",
"2027-04-15": "Khmer New Year's Day",
"2027-04-16": "Khmer New Year's Day",
"2027-05-01": "International Labor Day",
"2027-05-14": "HM King Norodom Sihamoni's Birthday",
"2027-05-20": "Visaka Bochea Day",
Expand Down Expand Up @@ -825,9 +826,9 @@
"2029-01-01": "International New Year Day",
"2029-01-07": "Day of Victory over the Genocidal Regime",
"2029-03-08": "International Women's Rights Day",
"2029-04-13": "Khmer New Year's Day",
"2029-04-14": "Khmer New Year's Day",
"2029-04-15": "Khmer New Year's Day",
"2029-04-16": "Khmer New Year's Day",
"2029-04-27": "Visaka Bochea Day",
"2029-05-01": "International Labor Day; Royal Ploughing Ceremony",
"2029-05-14": "HM King Norodom Sihamoni's Birthday",
Expand All @@ -845,9 +846,9 @@
"2030-01-01": "International New Year Day",
"2030-01-07": "Day of Victory over the Genocidal Regime",
"2030-03-08": "International Women's Rights Day",
"2030-04-13": "Khmer New Year's Day",
"2030-04-14": "Khmer New Year's Day",
"2030-04-15": "Khmer New Year's Day",
"2030-04-16": "Khmer New Year's Day",
"2030-05-01": "International Labor Day",
"2030-05-14": "HM King Norodom Sihamoni's Birthday",
"2030-05-16": "Visaka Bochea Day",
Expand All @@ -865,9 +866,9 @@
"2031-01-01": "International New Year Day",
"2031-01-07": "Day of Victory over the Genocidal Regime",
"2031-03-08": "International Women's Rights Day",
"2031-04-13": "Khmer New Year's Day",
"2031-04-14": "Khmer New Year's Day",
"2031-04-15": "Khmer New Year's Day",
"2031-04-16": "Khmer New Year's Day",
"2031-05-01": "International Labor Day",
"2031-05-05": "Visaka Bochea Day",
"2031-05-09": "Royal Ploughing Ceremony",
Expand Down
15 changes: 14 additions & 1 deletion tests/countries/test_cambodia.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def test_special_holidays(self):
"2020-08-19",
"2020-08-20",
"2020-08-21",
"2024-04-16",
)

def test_2022(self):
Expand Down Expand Up @@ -139,7 +140,19 @@ def test_day_of_victory_over_genocidal_regime(self):
)

def test_sangkranta(self):
sangkranta_years_apr14 = {2017, 2018, 2021, 2022, 2023}
sangkranta_years_apr14 = {
2017,
2018,
2021,
2022,
2023,
2025,
2026,
2027,
2029,
2030,
2031,
}
for year in set(range(1993, 2058)).difference({2020}):
if year in sangkranta_years_apr14:
self.assertHoliday(f"{year}-04-14", f"{year}-04-15", f"{year}-04-16")
Expand Down

0 comments on commit 17e3780

Please sign in to comment.