Using MIDNIGHT constant instead of number

This commit is contained in:
Sam Splunks 2024-03-27 15:59:25 +00:00
parent 1d8fc2ad42
commit acecc41ec8

View File

@ -220,7 +220,7 @@ def daily_time_spent_calculation(earliest, latest, open_hours):
latest_f = latest.hour + latest.minute / 60 + latest.second / (60 * 60) + latest.microsecond / (60 * 60 * 999999)
# if latest time is midnight and close hour is midnight, add a second to the time spent
if latest_f >= 24 and end == MIDNIGHT:
if latest_f >= MIDNIGHT and end == MIDNIGHT:
time_spent_seconds += 1
if earliest_f < start: