Update comments

This commit is contained in:
Sam Splunks 2024-02-14 12:33:20 +00:00
parent a671a9e8dc
commit eb9d947dd6

View File

@ -197,7 +197,7 @@ def convert_value(value):
def daily_time_spent_calculation(earliest, latest, open_hours): def daily_time_spent_calculation(earliest, latest, open_hours):
"""Returns timedelta for a single day time interval according to open hours.""" """Returns the number of seconds for a single day time interval according to open hours."""
# avoid rendering day in different locale # avoid rendering day in different locale
weekday = ('monday', 'tuesday', 'wednesday', 'thursday', weekday = ('monday', 'tuesday', 'wednesday', 'thursday',
@ -209,7 +209,7 @@ def daily_time_spent_calculation(earliest, latest, open_hours):
if not 0 <= start <= end <= MIDNIGHT: if not 0 <= start <= end <= MIDNIGHT:
start, end = 0, MIDNIGHT start, end = 0, MIDNIGHT
# transform decimals to minutes # transform decimals to minutes and seconds
start_hour, start_minute, start_second = int(start), int(start % 1 * 60), int(start * 60 % 1 * 60) start_hour, start_minute, start_second = int(start), int(start % 1 * 60), int(start * 60 % 1 * 60)
end_hour, end_minute, end_second = int(end), int(end % 1 * 60), int(end * 60 % 1 * 60) end_hour, end_minute, end_second = int(end), int(end % 1 * 60), int(end * 60 % 1 * 60)