Skip to content

Commit

Permalink
[LA] Implementing Suggestions 20230926
Browse files Browse the repository at this point in the history
Co-Authored-By: ~Jhellico <[email protected]>
  • Loading branch information
PPsyrius and KJhellico committed Sep 27, 2023
1 parent 0355ad4 commit da8fbb5
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 64 deletions.
2 changes: 1 addition & 1 deletion holidays/calendars/thai.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def atthami_bucha_date(self, year: int, calendar=None) -> Optional[date]:
else +169
)

def asarnha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
def asarnha_bucha_date(self, year: int) -> Optional[date]:
"""
Calculate the estimated Gregorian date of Asarnha Bucha.
If the Gregorian year input is invalid, this will outputs None instead.
Expand Down
39 changes: 17 additions & 22 deletions holidays/countries/laos.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)

from datetime import date
from gettext import gettext as tr

from holidays.calendars.gregorian import JAN, MAR, APR, MAY, JUL, OCT, DEC
Expand Down Expand Up @@ -138,10 +137,7 @@ class Laos(ObservedHolidayBase, InternationalHolidays, ThaiCalendarHolidays):
def __init__(self, *args, **kwargs):
InternationalHolidays.__init__(self)
ThaiCalendarHolidays.__init__(self, KHMER_CALENDAR)
super().__init__(observed_rule=SAT_SUN_TO_NEXT_MON, *args, **kwargs)

def _is_observed(self, dt: date) -> bool:
return self._year >= 2018
super().__init__(observed_rule=SAT_SUN_TO_NEXT_MON, observed_since=2018, *args, **kwargs)

def _populate_bank_holidays(self):
# Based on both LSX and BCEL calendar.
Expand Down Expand Up @@ -170,7 +166,7 @@ def _populate_bank_holidays(self):
# Lao Year-End Bank Holiday.
year_end_bank_holiday = tr("ສາມວັນລັດຖະການສຸດທ້າຍຂອງທຸກໆປີ")

dec_31 = date(self._year, DEC, 31)
dec_31 = (DEC, 31)
if self._is_monday(dec_31):
self._add_holiday_last_thu_of_dec(year_end_bank_holiday)
self._add_holiday_last_fri_of_dec(year_end_bank_holiday)
Expand Down Expand Up @@ -213,23 +209,20 @@ def _populate_public_holidays(self):
# ບຸນປີໃໝ່ລາວ
# Status: In-Use.
# Celebrated for 3 days from 14-16 April annualy.
# Observed dates prior to 2018 are assigned manually.
# - CASE 1: THU-FRI-SAT -> in-lieu on MON.
# - CASE 2: FRI-SAT-SUN -> in-lieu on MON-TUE.
# - CASE 3: SAT-SUN-MON -> in-lieu on TUE-WED.
# - CASE 4: SUN-MON-TUE -> in-lieu on WED.

# Lao New Year's Day.
name = tr("ບຸນປີໃໝ່ລາວ")
dt = self._add_holiday_apr_14(name)
self._add_holiday_apr_15(name)
self._add_holiday_apr_16(name)

# ພັກຊົດເຊີຍບຸນປີໃໝ່ລາວ
# Dates prior to 2018 are assigned manually
# Status: In-Use.
# - CASE 1: THU-FRI-SAT -> in-lieu on MON.
# - CASE 2: FRI-SAT-SUN -> in-lieu on MON-TUE.
# - CASE 3: SAT-SUN-MON -> in-lieu on TUE-WED.
# - CASE 4: SUN-MON-TUE -> in-lieu on WED.
if self._year >= 2018:
self._add_observed(dt, rule=THU_FRI_SAT_TO_NEXT_MON_TUE)
self._add_observed(dt, rule=FRI_SAT_SUN_TO_NEXT_TUE_WED)
self._add_observed(dt, rule=THU_FRI_SAT_TO_NEXT_MON_TUE)
self._add_observed(dt, rule=FRI_SAT_SUN_TO_NEXT_TUE_WED)

# ວັນກຳມະກອນສາກົນ
# Status: In-Use.
Expand Down Expand Up @@ -380,10 +373,11 @@ def _populate_workday_holidays(self):

# ວັນປູກຕົ້ນໄມ້ແຫ່ງຊາດ
# Status: In-Use.
# No information on when this was first observed is available in Thai or English sources.
# Assumed to first observed in 1989 following the National Forestry Conference in May.

# National Arbor Day.
self._add_holiday_jun_1(tr("ວັນປູກຕົ້ນໄມ້ແຫ່ງຊາດ"))
if self._year >= 1989:
# National Arbor Day.
self._add_holiday_jun_1(tr("ວັນປູກຕົ້ນໄມ້ແຫ່ງຊາດ"))

# ວັນຄ້າຍວັນເກີດ ທ່ານ ປະທານ ສຸພານຸວົງ
# Status: In-Use.
Expand All @@ -394,10 +388,11 @@ def _populate_workday_holidays(self):

# ວັນປ່ອຍປາ ແລະ ວັນອະນຸລັກສັດນ້ຳ-ສັດປ່າແຫ່ງຊາດ
# Status: In-Use.
# No information on when this was first observed is available in Thai or English sources.
# First designated in 1997 to concide with Souphanouvong's Birthday anniversary.

# The National Day for Wildlife and Aquatic Animal Conservation.
self._add_holiday_jul_13(tr("ວັນປ່ອຍປາ ແລະ ວັນອະນຸລັກສັດນ້ຳ-ສັດປ່າແຫ່ງຊາດ"))
if self._year >= 1997:
# The National Day for Wildlife and Aquatic Animal Conservation.
self._add_holiday_jul_13(tr("ວັນປ່ອຍປາ ແລະ ວັນອະນຸລັກສັດນ້ຳ-ສັດປ່າແຫ່ງຊາດ"))

# ວັນສ້າງຕັ້ງສະຫະພັນແມ່ຍິງລາວ
# Status: In-Use.
Expand Down
55 changes: 21 additions & 34 deletions snapshots/countries/LA.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
"1976-04-16": "Lao New Year's Day",
"1976-05-01": "Labor Day",
"1976-05-13": "Visakha Bousa Festival",
"1976-06-01": "National Arbor Day",
"1976-07-11": "Begin of Buddhist Lent",
"1976-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1976-07-13": "President Souphanouvong's Birthday",
"1976-07-20": "Establishment Day of the Lao Women's Union",
"1976-08-13": "Lao National Mass Media and Publishing Day",
"1976-08-23": "National Uprising Day",
Expand All @@ -38,8 +37,7 @@
"1977-04-16": "Lao New Year's Day",
"1977-05-01": "Labor Day",
"1977-05-02": "Visakha Bousa Festival",
"1977-06-01": "National Arbor Day",
"1977-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1977-07-13": "President Souphanouvong's Birthday",
"1977-07-20": "Establishment Day of the Lao Women's Union",
"1977-07-30": "Begin of Buddhist Lent",
"1977-08-13": "Lao National Mass Media and Publishing Day",
Expand All @@ -66,8 +64,7 @@
"1978-04-16": "Lao New Year's Day",
"1978-05-01": "Labor Day",
"1978-05-21": "Visakha Bousa Festival",
"1978-06-01": "National Arbor Day",
"1978-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1978-07-13": "President Souphanouvong's Birthday",
"1978-07-19": "Begin of Buddhist Lent",
"1978-07-20": "Establishment Day of the Lao Women's Union",
"1978-08-13": "Lao National Mass Media and Publishing Day",
Expand All @@ -94,9 +91,8 @@
"1979-04-16": "Lao New Year's Day",
"1979-05-01": "Labor Day",
"1979-05-10": "Visakha Bousa Festival",
"1979-06-01": "National Arbor Day",
"1979-07-09": "Begin of Buddhist Lent",
"1979-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1979-07-13": "President Souphanouvong's Birthday",
"1979-07-20": "Establishment Day of the Lao Women's Union",
"1979-08-13": "Lao National Mass Media and Publishing Day",
"1979-08-22": "Boun Haw Khao Padapdin",
Expand All @@ -120,8 +116,7 @@
"1980-04-16": "Lao New Year's Day",
"1980-04-29": "Visakha Bousa Festival",
"1980-05-01": "Labor Day",
"1980-06-01": "National Arbor Day",
"1980-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1980-07-13": "President Souphanouvong's Birthday",
"1980-07-20": "Establishment Day of the Lao Women's Union",
"1980-07-27": "Begin of Buddhist Lent",
"1980-08-13": "Lao National Mass Media and Publishing Day",
Expand All @@ -148,8 +143,7 @@
"1981-04-16": "Lao New Year's Day",
"1981-05-01": "Labor Day",
"1981-05-18": "Visakha Bousa Festival",
"1981-06-01": "National Arbor Day",
"1981-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1981-07-13": "President Souphanouvong's Birthday",
"1981-07-16": "Begin of Buddhist Lent",
"1981-07-20": "Establishment Day of the Lao Women's Union",
"1981-08-13": "Lao National Mass Media and Publishing Day",
Expand All @@ -176,9 +170,8 @@
"1982-04-16": "Lao New Year's Day",
"1982-05-01": "Labor Day",
"1982-05-07": "Visakha Bousa Festival",
"1982-06-01": "National Arbor Day",
"1982-07-05": "Begin of Buddhist Lent",
"1982-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1982-07-13": "President Souphanouvong's Birthday",
"1982-07-20": "Establishment Day of the Lao Women's Union",
"1982-08-13": "Lao National Mass Media and Publishing Day",
"1982-08-18": "Boun Haw Khao Padapdin",
Expand All @@ -204,8 +197,7 @@
"1983-04-16": "Lao New Year's Day",
"1983-04-26": "Visakha Bousa Festival",
"1983-05-01": "Labor Day",
"1983-06-01": "National Arbor Day",
"1983-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1983-07-13": "President Souphanouvong's Birthday",
"1983-07-20": "Establishment Day of the Lao Women's Union",
"1983-07-24": "Begin of Buddhist Lent",
"1983-08-13": "Lao National Mass Media and Publishing Day",
Expand All @@ -232,9 +224,8 @@
"1984-04-16": "Lao New Year's Day",
"1984-05-01": "Labor Day",
"1984-05-14": "Visakha Bousa Festival",
"1984-06-01": "National Arbor Day",
"1984-07-12": "Begin of Buddhist Lent",
"1984-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1984-07-13": "President Souphanouvong's Birthday",
"1984-07-20": "Establishment Day of the Lao Women's Union",
"1984-08-13": "Lao National Mass Media and Publishing Day",
"1984-08-23": "National Uprising Day",
Expand All @@ -260,8 +251,7 @@
"1985-04-16": "Lao New Year's Day",
"1985-05-01": "Labor Day",
"1985-05-03": "Visakha Bousa Festival",
"1985-06-01": "National Arbor Day",
"1985-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1985-07-13": "President Souphanouvong's Birthday",
"1985-07-20": "Establishment Day of the Lao Women's Union",
"1985-07-31": "Begin of Buddhist Lent",
"1985-08-13": "Lao National Mass Media and Publishing Day",
Expand All @@ -288,8 +278,7 @@
"1986-04-16": "Lao New Year's Day",
"1986-05-01": "Labor Day",
"1986-05-22": "Visakha Bousa Festival",
"1986-06-01": "National Arbor Day",
"1986-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1986-07-13": "President Souphanouvong's Birthday",
"1986-07-20": "Begin of Buddhist Lent; Establishment Day of the Lao Women's Union",
"1986-08-13": "Lao National Mass Media and Publishing Day",
"1986-08-23": "National Uprising Day",
Expand All @@ -315,9 +304,8 @@
"1987-04-16": "Lao New Year's Day",
"1987-05-01": "Labor Day",
"1987-05-11": "Visakha Bousa Festival",
"1987-06-01": "National Arbor Day",
"1987-07-10": "Begin of Buddhist Lent",
"1987-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1987-07-13": "President Souphanouvong's Birthday",
"1987-07-20": "Establishment Day of the Lao Women's Union",
"1987-08-13": "Lao National Mass Media and Publishing Day",
"1987-08-23": "Boun Haw Khao Padapdin; National Uprising Day",
Expand All @@ -341,8 +329,7 @@
"1988-04-16": "Lao New Year's Day",
"1988-04-30": "Visakha Bousa Festival",
"1988-05-01": "Labor Day",
"1988-06-01": "National Arbor Day",
"1988-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1988-07-13": "President Souphanouvong's Birthday",
"1988-07-20": "Establishment Day of the Lao Women's Union",
"1988-07-28": "Begin of Buddhist Lent",
"1988-08-13": "Lao National Mass Media and Publishing Day",
Expand Down Expand Up @@ -370,7 +357,7 @@
"1989-05-01": "Labor Day",
"1989-05-19": "Visakha Bousa Festival",
"1989-06-01": "National Arbor Day",
"1989-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1989-07-13": "President Souphanouvong's Birthday",
"1989-07-17": "Begin of Buddhist Lent",
"1989-07-20": "Establishment Day of the Lao Women's Union",
"1989-08-13": "Lao National Mass Media and Publishing Day",
Expand Down Expand Up @@ -399,7 +386,7 @@
"1990-05-08": "Visakha Bousa Festival",
"1990-06-01": "International Children Day; National Arbor Day",
"1990-07-07": "Begin of Buddhist Lent",
"1990-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1990-07-13": "President Souphanouvong's Birthday",
"1990-07-20": "Establishment Day of the Lao Women's Union",
"1990-08-13": "Lao National Mass Media and Publishing Day",
"1990-08-20": "Boun Haw Khao Padapdin",
Expand All @@ -426,7 +413,7 @@
"1991-04-28": "Visakha Bousa Festival",
"1991-05-01": "Labor Day",
"1991-06-01": "International Children Day; National Arbor Day",
"1991-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1991-07-13": "President Souphanouvong's Birthday",
"1991-07-20": "Establishment Day of the Lao Women's Union",
"1991-07-26": "Begin of Buddhist Lent",
"1991-08-13": "Lao National Mass Media and Publishing Day",
Expand Down Expand Up @@ -456,7 +443,7 @@
"1992-05-01": "Labor Day",
"1992-05-16": "Visakha Bousa Festival",
"1992-06-01": "International Children Day; National Arbor Day",
"1992-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1992-07-13": "President Souphanouvong's Birthday",
"1992-07-14": "Begin of Buddhist Lent",
"1992-07-20": "Establishment Day of the Lao Women's Union",
"1992-08-13": "Lao National Mass Media and Publishing Day",
Expand Down Expand Up @@ -486,7 +473,7 @@
"1993-05-05": "Visakha Bousa Festival",
"1993-06-01": "International Children Day; National Arbor Day",
"1993-07-03": "Begin of Buddhist Lent",
"1993-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1993-07-13": "President Souphanouvong's Birthday",
"1993-07-20": "Establishment Day of the Lao Women's Union",
"1993-08-13": "Lao National Mass Media and Publishing Day",
"1993-08-15": "Lao National Constitution Day",
Expand Down Expand Up @@ -515,7 +502,7 @@
"1994-04-24": "Visakha Bousa Festival",
"1994-05-01": "Labor Day",
"1994-06-01": "International Children Day; National Arbor Day",
"1994-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1994-07-13": "President Souphanouvong's Birthday",
"1994-07-20": "Establishment Day of the Lao Women's Union",
"1994-07-22": "Begin of Buddhist Lent",
"1994-08-13": "Lao National Mass Media and Publishing Day",
Expand Down Expand Up @@ -546,7 +533,7 @@
"1995-05-13": "Visakha Bousa Festival",
"1995-06-01": "International Children Day; National Arbor Day",
"1995-07-11": "Begin of Buddhist Lent",
"1995-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1995-07-13": "President Souphanouvong's Birthday",
"1995-07-20": "Establishment Day of the Lao Women's Union",
"1995-08-13": "Lao National Mass Media and Publishing Day",
"1995-08-15": "Lao National Constitution Day",
Expand Down Expand Up @@ -574,7 +561,7 @@
"1996-04-16": "Lao New Year's Day",
"1996-05-01": "Labor Day; Visakha Bousa Festival",
"1996-06-01": "International Children Day; National Arbor Day",
"1996-07-13": "President Souphanouvong's Birthday; The National Day for Wildlife and Aquatic Animal Conservation",
"1996-07-13": "President Souphanouvong's Birthday",
"1996-07-20": "Establishment Day of the Lao Women's Union",
"1996-07-29": "Begin of Buddhist Lent",
"1996-08-13": "Lao National Mass Media and Publishing Day",
Expand Down
Loading

0 comments on commit da8fbb5

Please sign in to comment.