Merge branch 'KontorNoLimit-master'

This commit is contained in:
SiHuan 2021-03-10 16:43:52 +08:00
commit 154e4618bf

View file

@ -47,17 +47,23 @@ def getWeather(id='101120206'):
def calendar(): def calendar():
# 可选 教学、寒假、暑假 等
NowStatus = "教学"
# 开始周次是今年的第几周
StartWeek = 8
# 今年考研开始日期
KaoYanDate = datetime(2021, 12, 21)
ymc = ["", "", "", "", "", "", "", "", "", "", "", ""] ymc = ["", "", "", "", "", "", "", "", "", "", "", ""]
rmc = ["初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十", "十一", "十二", "十三", "十四", "十五", rmc = ["初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十", "十一", "十二", "十三", "十四", "十五",
"十六", "十七", "十八", "十九", "二十", "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十", "卅一"] "十六", "十七", "十八", "十九", "二十", "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十", "卅一"]
zmc = ["", "", "", "", "", "", ""] zmc = ["", "", "", "", "", "", ""]
nowdate = datetime.now() nowdate = datetime.now()
kaoyandate = datetime(2021,12,21) djs = (KaoYanDate - nowdate).days -1
djs = (kaoyandate - nowdate).days -1
y = nowdate.year y = nowdate.year
m = nowdate.month m = nowdate.month
d = nowdate.day d = nowdate.day
zc = int(nowdate.strftime("%W")) - 1 zc = int(nowdate.strftime("%W")) - StartWeek
z = zmc[nowdate.weekday()] z = zmc[nowdate.weekday()]
@ -68,5 +74,5 @@ def calendar():
if lunarday.Lleap: if lunarday.Lleap:
lunardaychinese = "" + lunardaychinese 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 return cal