bugfix: time with 24:00... and assign string properly

This commit is contained in:
Lea 2024-08-28 17:19:38 +02:00
parent f6315e4403
commit c7fe1a1e22

View File

@ -239,7 +239,7 @@ class APIHandler:
if "24:00" in date_string: if "24:00" in date_string:
# Sometimes the API returns 24:00 as time, so filtering for those cases and replacing it with a minute # Sometimes the API returns 24:00 as time, so filtering for those cases and replacing it with a minute
# less to work with propery input # less to work with propery input
date_string.replace("24:00", "23:59") date_string =date_string.replace("24:00", "23:59")
# Add the current year since it is not part of the original date sent by the API # Add the current year since it is not part of the original date sent by the API
parsed_date = datetime.strptime(date_string, format_string).replace(year=datetime.now().year) parsed_date = datetime.strptime(date_string, format_string).replace(year=datetime.now().year)