This commit is contained in:
Administrator
2022-10-22 22:33:48 +03:00
parent c9ad723222
commit 6a69681e9f
2 changed files with 6 additions and 2 deletions

View File

@@ -20,6 +20,9 @@ def get_next_daily_notify_time(user: User, time_now: datetime.datetime | None =
hour=hours,
minute=minutes
)
print('now time is', time_now)
print('user wants to notify at', hours, minutes)
if time_now.hour * 60 + time_now.minute < hours * 60 + minutes:
print('go to next day')
next_time = next_time + datetime.timedelta(days=1)
return next_time