Support exam days_left

This commit is contained in:
xtaodada 2023-06-01 19:17:03 +08:00
parent 99daff1564
commit 146af56314
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,11 @@ class AiExam(BaseModel):
""" 获取课程名称(去除课程编号) """
return self.name.split("]")[-1]
@property
def days_left(self) -> int:
""" 获取距离考试的天数 """
return (self.get_time()[0] - datetime.datetime.now()).days
def get_time(self) -> Tuple[datetime.datetime, datetime.datetime]:
""" 获取格式化后的考试时间 """
# 2023-06-25(18周 星期日)09:00-11:00

View File

@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setuptools.setup(
name="cqwu", # 用自己的名替换其中的YOUR_USERNAME_
version="0.0.11", # 包版本号,便于维护版本
version="0.0.12", # 包版本号,便于维护版本
author="omg-xtao", # 作者,可以写自己的姓名
author_email="xtao@xtaolink.cn", # 作者联系方式,可写自己的邮箱地址
description="A cqwu ehall client.", # 包的简述