Adding second precision for float conversion

This commit is contained in:
Sam Splunks 2024-02-14 10:21:34 +00:00
parent 05dfde59cb
commit c3f6a1caa2

View File

@ -214,8 +214,8 @@ def daily_time_spent_calculation(earliest, latest, open_hours):
end_hour, end_minute, end_second = int(end), int(end % 1 * 60), int(end * 60 % 1 * 60)
# translate time for delta calculation
earliest_f = earliest.hour + earliest.minute / 60
latest_f = latest.hour + latest.minute / 60
earliest_f = earliest.hour + earliest.minute / 60 + earliest.second / 3600
latest_f = latest.hour + latest.minute / 60 + latest.second / 3600
if earliest_f < start:
earliest = earliest.replace(hour=start_hour, minute=start_minute, second=start_second)