mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-17 08:40:56 +00:00
Drop Korea class from hdays.py (#1438)
To solve this [issue](https://github.com/facebook/prophet/issues/1437) by @chongdae Korean lunar calendar which is different from Chinese lunar calendar is added python-holidays package recently. This commit is about dropping the Korean and KR class in hdays.py file and hdays_part1(holidays) will work for Korean holidays. ``` import fbprophet.hdays as hdays_part2 import holidays as hdays_part1 ``
This commit is contained in:
parent
f16d9df333
commit
5669f13abf
1 changed files with 0 additions and 70 deletions
|
|
@ -1364,76 +1364,6 @@ class RU(Russia):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
# ------------ Holidays in Republic of Korea---------------------
|
|
||||||
class Korea(HolidayBase):
|
|
||||||
"""
|
|
||||||
Implement public holidays in Republic of Korea
|
|
||||||
Reference:
|
|
||||||
https://en.wikipedia.org/wiki/Public_holidays_in_South_Korea
|
|
||||||
"""
|
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
|
||||||
self.country = "KR"
|
|
||||||
HolidayBase.__init__(self, **kwargs)
|
|
||||||
|
|
||||||
def _populate(self, year):
|
|
||||||
# New Year's Day
|
|
||||||
name = "New Year's Day"
|
|
||||||
self[date(year, 1, 1)] = name
|
|
||||||
|
|
||||||
# New Year's Day by the Lunar
|
|
||||||
name = "New Year's Day by the Lunar"
|
|
||||||
for offset in range(-1, 2, 1):
|
|
||||||
ds = Converter.Lunar2Solar(Lunar(year + offset, 1, 1)).to_date()
|
|
||||||
if ds.year == year:
|
|
||||||
self[ds] = name
|
|
||||||
|
|
||||||
# Independence Movement Day
|
|
||||||
name = "Independence Movement Day"
|
|
||||||
self[date(year, 3, 1)] = name
|
|
||||||
|
|
||||||
# Buddha's Birthday
|
|
||||||
name = "Buddha's Birthday"
|
|
||||||
for offset in range(-1, 2, 1):
|
|
||||||
ds = Converter.Lunar2Solar(Lunar(year + offset, 4, 8)).to_date()
|
|
||||||
if ds.year == year:
|
|
||||||
self[ds] = name
|
|
||||||
|
|
||||||
# Children's Day
|
|
||||||
name = "Children's Day"
|
|
||||||
self[date(year, 5, 5)] = name
|
|
||||||
|
|
||||||
# Memorial Day
|
|
||||||
name = "Memorial Day"
|
|
||||||
self[date(year, 6, 6)] = name
|
|
||||||
|
|
||||||
# Liberation Day
|
|
||||||
name = "Liberation Day"
|
|
||||||
self[date(year, 8, 15)] = name
|
|
||||||
|
|
||||||
# Chuseok
|
|
||||||
name = "Chuseok"
|
|
||||||
for offset in range(-1, 2, 1):
|
|
||||||
ds = Converter.Lunar2Solar(Lunar(year + offset, 8, 15)).to_date()
|
|
||||||
if ds.year == year:
|
|
||||||
self[ds] = name
|
|
||||||
|
|
||||||
# National Foundation Day
|
|
||||||
name = "National Foundation Day"
|
|
||||||
self[date(year, 10, 3)] = name
|
|
||||||
|
|
||||||
# Hangeul Proclamation Day
|
|
||||||
name = "Hangeul Proclamation Day"
|
|
||||||
self[date(year, 10, 9)] = name
|
|
||||||
|
|
||||||
# Christmas Day
|
|
||||||
name = "Christmas Day"
|
|
||||||
self[date(year, 12, 25)] = name
|
|
||||||
|
|
||||||
class KR(Korea):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# ------------ Holidays in Belarus---------------------
|
# ------------ Holidays in Belarus---------------------
|
||||||
class Belarus(HolidayBase):
|
class Belarus(HolidayBase):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue