Repository: LKI/chinese-calendar

Issue:
2020国务院新的节假日来了
http://www.gov.cn/zhengce/content/2020-01/27/content_5472352.htm

Discussion:

Patch:
diff --git a/chinese_calendar/constants.py b/chinese_calendar/constants.py
index 5ec57ed..2bce1a7 100644
--- a/chinese_calendar/constants.py
+++ b/chinese_calendar/constants.py
@@ -441,6 +441,9 @@ holidays = {
     datetime.date(year=2020, month=1, day=28): Holiday.spring_festival.value,
     datetime.date(year=2020, month=1, day=29): Holiday.spring_festival.value,
     datetime.date(year=2020, month=1, day=30): Holiday.spring_festival.value,
+    datetime.date(year=2020, month=1, day=31): Holiday.spring_festival.value,
+    datetime.date(year=2020, month=2, day=1): Holiday.spring_festival.value,
+    datetime.date(year=2020, month=2, day=2): Holiday.spring_festival.value,
     datetime.date(year=2020, month=4, day=4): Holiday.tomb_sweeping_day.value,
     datetime.date(year=2020, month=4, day=5): Holiday.tomb_sweeping_day.value,
     datetime.date(year=2020, month=4, day=6): Holiday.tomb_sweeping_day.value,
@@ -565,7 +568,6 @@ workdays = {
     datetime.date(year=2019, month=9, day=29): Holiday.national_day.value,
     datetime.date(year=2019, month=10, day=12): Holiday.national_day.value,
     datetime.date(year=2020, month=1, day=19): Holiday.spring_festival.value,
-    datetime.date(year=2020, month=2, day=1): Holiday.spring_festival.value,
     datetime.date(year=2020, month=4, day=26): Holiday.labour_day.value,
     datetime.date(year=2020, month=5, day=9): Holiday.labour_day.value,
     datetime.date(year=2020, month=6, day=28): Holiday.dragon_boat_festival.value,
@@ -677,7 +679,6 @@ in_lieu_days = {
     datetime.date(year=2019, month=10, day=4): Holiday.national_day.value,
     datetime.date(year=2019, month=10, day=7): Holiday.national_day.value,
     datetime.date(year=2020, month=1, day=29): Holiday.spring_festival.value,
-    datetime.date(year=2020, month=1, day=30): Holiday.spring_festival.value,
     datetime.date(year=2020, month=5, day=4): Holiday.labour_day.value,
     datetime.date(year=2020, month=5, day=5): Holiday.labour_day.value,
     datetime.date(year=2020, month=6, day=26): Holiday.dragon_boat_festival.value,
diff --git a/chinese_calendar/scripts/data.py b/chinese_calendar/scripts/data.py
index 5669676..449118c 100644
--- a/chinese_calendar/scripts/data.py
+++ b/chinese_calendar/scripts/data.py
@@ -73,10 +73,13 @@ class Arrangement(object):
         四、劳动节：5月1日至5日放假调休，共5天。4月26日（星期日）、5月9日（星期六）上班。
         五、端午节：6月25日至27日放假调休，共3天。6月28日（星期日）上班。
         六、国庆节、中秋节：10月1日至8日放假调休，共8天。9月27日（星期日）、10月10日（星期六）上班。
+
+        http://www.gov.cn/zhengce/content/2020-01/27/content_5472352.htm
+        延长2020年春节假期至2月2日（农历正月初九，星期日），2月3日（星期一）起正常上班。
         """
         self.year_at(2020) \
             .nyd().rest(1, 1) \
-            .sf().rest(1, 24).to(1, 30).work(1, 19).work(2, 1).in_lieu(1, 29).to(1, 30) \
+            .sf().rest(1, 24).to(2, 2).work(1, 19).in_lieu(1, 29) \
             .tsd().rest(4, 4).to(4, 6) \
             .ld().rest(5, 1).to(5, 5).work(4, 26).work(5, 9).in_lieu(5, 4).to(5, 5) \
             .dbf().rest(6, 25).to(6, 27).work(6, 28).in_lieu(6, 26) \


Test patch:
diff --git a/tests/test_holiday_amount.py b/tests/test_holiday_amount.py
index 04dd7af..fa1a95b 100644
--- a/tests/test_holiday_amount.py
+++ b/tests/test_holiday_amount.py
@@ -21,6 +21,7 @@ class HolidayAmountTests(unittest.TestCase):
         holiday_amounts[2011] += 1  # 11年要补班12年的元旦假期
         holiday_amounts[2012] -= 1  # 12年可以享受11年补班的假
         holiday_amounts[2015] -= 1  # 15年是中国人民抗日战争暨世界反法西斯战争胜利70周年，多放1天
-        for year in range(2007, 2018 + 1):  # 06年数据少，不测了
+        holiday_amounts[2020] -= 2  # 20年春节因为新型冠状病毒疫情防控，延长假期2天
+        for year in range(2007, 2020 + 1):  # 06年数据少，不测了
             self.assertEqual(11, holiday_amounts[year], 'Holiday amount of year {}'.format(year))
         self.assertEqual(1, 1)