mirror of https://github.com/Mai-with-u/MaiBot.git
Fix in case schedule generate a [xx:00 - xx:00]
防止生成日程时仍然出现时间段导致datetime无法解析,对time进行[:4]的切片pull/359/head
parent
2578f3a3ae
commit
bffacb2403
|
|
@ -138,8 +138,8 @@ class ScheduleGenerator:
|
|||
time1 = "23:59"
|
||||
if time2 == "24:00":
|
||||
time2 = "23:59"
|
||||
t1 = datetime.datetime.strptime(time1, "%H:%M")
|
||||
t2 = datetime.datetime.strptime(time2, "%H:%M")
|
||||
t1 = datetime.datetime.strptime(time1[:4], "%H:%M")
|
||||
t2 = datetime.datetime.strptime(time2[:4], "%H:%M")
|
||||
diff = int((t2 - t1).total_seconds() / 60)
|
||||
# 考虑时间的循环性
|
||||
if diff < -720:
|
||||
|
|
|
|||
Loading…
Reference in New Issue