Return precisely 86400 seconds for a full day

This commit is contained in:
Sam Splunks 2024-02-15 09:18:36 +00:00
parent 99b49e3f39
commit cec1035c2d

View File

@ -229,5 +229,9 @@ def daily_time_spent_calculation(earliest, latest, open_hours):
day_delta = latest - earliest
# returns up to 86399 seconds
return day_delta.seconds
# returns up to 86399 seconds, add one second if full day
time_spent_seconds = day_delta.seconds
if time_spent_seconds == 86399:
time_spent_seconds += 1
return time_spent_seconds