From 784cdf7fcced7df1a8b80413f69362564784d4d4 Mon Sep 17 00:00:00 2001 From: wolfbolin Date: Sat, 19 Oct 2019 11:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=91=A8=E6=97=A5=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E9=94=99=E4=BD=8DBUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- everyclass/server/calendar/ics_generator.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/everyclass/server/calendar/ics_generator.py b/everyclass/server/calendar/ics_generator.py index b9af9c8..d46c807 100644 --- a/everyclass/server/calendar/ics_generator.py +++ b/everyclass/server/calendar/ics_generator.py @@ -93,6 +93,8 @@ def _get_datetime(week: int, day: int, time: Tuple[int, int], semester: Tuple[in :param semester: 学期 :return: datetime 类型的时间 """ + if day == 7: + week -= 1 config = get_config() tz = pytz.timezone("Asia/Shanghai") dt = datetime(*(config.AVAILABLE_SEMESTERS[semester]['start'] + time), tzinfo=tz) # noqa: T484