Skip to content

Commit

Permalink
fix: 2007-12-19,2008-09-27/28 should be workday (LKI#80)
Browse files Browse the repository at this point in the history
- related to LKI#79
  • Loading branch information
LKI authored Jan 14, 2022
1 parent bbbc7a2 commit 2d44efc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 6 additions & 0 deletions chinese_calendar/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,12 @@ def __new__(cls, english, chinese, days):
datetime.date(year=2007, month=4, day=29): Holiday.labour_day.value,
datetime.date(year=2007, month=9, day=29): Holiday.national_day.value,
datetime.date(year=2007, month=9, day=30): Holiday.national_day.value,
datetime.date(year=2007, month=12, day=29): Holiday.new_years_day.value,
datetime.date(year=2008, month=2, day=2): Holiday.spring_festival.value,
datetime.date(year=2008, month=2, day=3): Holiday.spring_festival.value,
datetime.date(year=2008, month=5, day=4): Holiday.labour_day.value,
datetime.date(year=2008, month=9, day=27): Holiday.national_day.value,
datetime.date(year=2008, month=9, day=28): Holiday.national_day.value,
datetime.date(year=2009, month=1, day=4): Holiday.new_years_day.value,
datetime.date(year=2009, month=1, day=24): Holiday.spring_festival.value,
datetime.date(year=2009, month=2, day=1): Holiday.spring_festival.value,
Expand Down Expand Up @@ -684,9 +687,12 @@ def __new__(cls, english, chinese, days):
datetime.date(year=2007, month=5, day=7): Holiday.labour_day.value,
datetime.date(year=2007, month=10, day=4): Holiday.national_day.value,
datetime.date(year=2007, month=10, day=5): Holiday.national_day.value,
datetime.date(year=2007, month=12, day=31): Holiday.new_years_day.value,
datetime.date(year=2008, month=2, day=11): Holiday.spring_festival.value,
datetime.date(year=2008, month=2, day=12): Holiday.spring_festival.value,
datetime.date(year=2008, month=5, day=2): Holiday.labour_day.value,
datetime.date(year=2008, month=9, day=29): Holiday.national_day.value,
datetime.date(year=2008, month=9, day=30): Holiday.national_day.value,
datetime.date(year=2009, month=1, day=2): Holiday.new_years_day.value,
datetime.date(year=2009, month=1, day=29): Holiday.spring_festival.value,
datetime.date(year=2009, month=1, day=30): Holiday.spring_festival.value,
Expand Down
4 changes: 2 additions & 2 deletions chinese_calendar/scripts/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def _2008(self):
.ld().rest(5, 1).to(5, 3).work(5, 4).in_lieu(5, 2) \
.dbf().rest(6, 7).to(6, 9) \
.maf().rest(9, 13).to(9, 15) \
.nd().rest(9, 29).to(10, 5)
.nd().rest(9, 29).to(10, 5).work(9, 27).to(9, 28).in_lieu(9, 29).to(9, 30)

def _2007(self):
""" http://www.gov.cn/fwxx/sh/2006-12/18/content_471877.htm
Expand All @@ -407,7 +407,7 @@ def _2007(self):
.sf().rest(2, 18).to(2, 24).work(2, 17).work(2, 25).in_lieu(2, 22).to(2, 23) \
.ld().rest(5, 1).to(5, 7).work(4, 28).to(4, 29).in_lieu(5, 4).in_lieu(5, 7) \
.nd().rest(10, 1).to(10, 7).work(9, 29).to(9, 30).in_lieu(10, 4).to(10, 5) \
.nyd().rest(12, 30).to(12, 31)
.nyd().rest(12, 30).to(12, 31).work(12, 29).in_lieu(12, 31)

def _2006(self):
""" http://www.gov.cn/jrzg/2005-12/22/content_133837.htm
Expand Down
3 changes: 1 addition & 2 deletions tests/test_holiday_amount.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ def test_holiday_amount(self):
for date in workdays.keys():
if date.weekday() > 4:
holiday_amounts[date.year] -= 1
holiday_amounts[2007] -= 2 # 07年法定节假日有13天(国庆多了两天)
holiday_amounts[2008] -= 2 # 08年同上
holiday_amounts[2007] -= 1 # 07年法定节假日有12天(国庆多了两天,元旦少了一天)
holiday_amounts[2011] += 1 # 11年要补班12年的元旦假期
holiday_amounts[2012] -= 1 # 12年可以享受11年补班的假
holiday_amounts[2015] -= 1 # 15年是中国人民抗日战争暨世界反法西斯战争胜利70周年,多放1天
Expand Down

0 comments on commit 2d44efc

Please sign in to comment.