Fix issue when scheduled datetime is passed
This commit is contained in:
parent
d604842cfc
commit
5920dfc822
1 changed files with 2 additions and 0 deletions
2
main.py
2
main.py
|
@ -112,6 +112,8 @@ async def stop(
|
||||||
def get_delai(heure_passage: str) -> str:
|
def get_delai(heure_passage: str) -> str:
|
||||||
dt = datetime.strptime(heure_passage, "%Y-%m-%d %H:%M:%S")
|
dt = datetime.strptime(heure_passage, "%Y-%m-%d %H:%M:%S")
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
if now > dt:
|
||||||
|
return "Proche"
|
||||||
delai = dt - now
|
delai = dt - now
|
||||||
minutes = delai.seconds // 60
|
minutes = delai.seconds // 60
|
||||||
if minutes <= 0:
|
if minutes <= 0:
|
||||||
|
|
Reference in a new issue