diff --git a/shiftregister/app/templatetags/shift_extras.py b/shiftregister/app/templatetags/shift_extras.py index c6e2a42..1f34c79 100644 --- a/shiftregister/app/templatetags/shift_extras.py +++ b/shiftregister/app/templatetags/shift_extras.py @@ -7,6 +7,7 @@ register = template.Library() def duration(value): secs = int(value.total_seconds()) hours = secs // (60 * 60) - secs = secs % (hours * 60 * 60) + if hours > 0: + secs = secs % (hours * 60 * 60) minutes = secs // 60 return f"{hours}:{minutes:02d}h"