From 9320781dc38f0422f679a523822e5b0a6f37a467 Mon Sep 17 00:00:00 2001 From: Kontor Date: Wed, 10 Mar 2021 16:21:34 +0800 Subject: [PATCH 1/2] Update zhaoan.py --- worker/zhaoan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/zhaoan.py b/worker/zhaoan.py index 06da5d3..c8c0ecf 100644 --- a/worker/zhaoan.py +++ b/worker/zhaoan.py @@ -57,7 +57,7 @@ def calendar(): y = nowdate.year m = nowdate.month d = nowdate.day - zc = int(nowdate.strftime("%W")) - 1 + zc = int(nowdate.strftime("%W")) - 8 z = zmc[nowdate.weekday()] @@ -68,5 +68,5 @@ def calendar(): if lunarday.Lleap: lunardaychinese = "闰" + lunardaychinese - cal = f"{m}月{d}日,{lunardaychinese},寒假第{zc}周,星期{z}\n\n距离 2022 考研还有 {djs} 天" + cal = f"{m}月{d}日,{lunardaychinese},第{zc}教学周,星期{z}\n\n距离 2022 考研还有 {djs} 天" return cal From ea37514001968aeae016e5cfea858a8ec1ba8942 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Wed, 10 Mar 2021 16:43:30 +0800 Subject: [PATCH 2/2] fix zhaoan --- worker/zhaoan.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/worker/zhaoan.py b/worker/zhaoan.py index c8c0ecf..215228d 100644 --- a/worker/zhaoan.py +++ b/worker/zhaoan.py @@ -47,17 +47,23 @@ def getWeather(id='101120206'): def calendar(): + # 可选 教学、寒假、暑假 等 + NowStatus = "教学" + # 开始周次是今年的第几周 + StartWeek = 8 + # 今年考研开始日期 + KaoYanDate = datetime(2021, 12, 21) + ymc = ["冬", "腊", "正", "二", "三", "四", "五", "六", "七", "八", "九", "十"] rmc = ["初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十", "卅一"] zmc = ["一", "二", "三", "四", "五", "六", "天"] nowdate = datetime.now() - kaoyandate = datetime(2021,12,21) - djs = (kaoyandate - nowdate).days -1 + djs = (KaoYanDate - nowdate).days -1 y = nowdate.year m = nowdate.month d = nowdate.day - zc = int(nowdate.strftime("%W")) - 8 + zc = int(nowdate.strftime("%W")) - StartWeek z = zmc[nowdate.weekday()] @@ -68,5 +74,5 @@ def calendar(): if lunarday.Lleap: lunardaychinese = "闰" + lunardaychinese - cal = f"{m}月{d}日,{lunardaychinese},第{zc}教学周,星期{z}\n\n距离 2022 考研还有 {djs} 天" + cal = f"{m}月{d}日,{lunardaychinese},{NowStatus}第{zc}周,星期{z}\n\n距离 2022 考研还有 {djs} 天" return cal