💩 add workaround to receive prayer times for the next 7 days (which is not persistet yet)
Some checks failed
Python formatting PEP8 / Python-PEP8 (push) Waiting to run
ci / docker (push) Has been cancelled

This commit is contained in:
Finn Christiansen 2024-06-13 22:46:06 +02:00
parent 3d602eacf9
commit c4cf6196aa

View file

@ -114,8 +114,10 @@ def get_praying_times(date: datetime.date, username) -> Dict[str, str]:
def schedule_reminder(username) -> None: def schedule_reminder(username) -> None:
# TODO: add peristence for reminders # TODO: add peristence for reminders
times = get_praying_times(datetime.date.today(), username)
now = datetime.datetime.now(datetime.UTC) now = datetime.datetime.now(datetime.UTC)
# as a workaround until it's finished schedule the next 7 days
for i in range(7):
times = get_praying_times(datetime.date.today() + datetime.timedelta(days=i), username)
for prayer, time in times.items(): for prayer, time in times.items():
praying_time = datetime.datetime.fromisoformat(time) praying_time = datetime.datetime.fromisoformat(time)
if praying_time > now: if praying_time > now: