|
|
@ -5,8 +5,8 @@ register = template.Library()
|
|
|
|
|
|
|
|
|
|
|
|
@register.filter(name="duration")
|
|
|
|
@register.filter(name="duration")
|
|
|
|
def duration(value):
|
|
|
|
def duration(value):
|
|
|
|
secs = value.total_seconds()
|
|
|
|
secs = int(value.total_seconds())
|
|
|
|
hours = int(secs // (60 * 60))
|
|
|
|
hours = secs // (60 * 60)
|
|
|
|
secs = secs % (hours * 60 * 60)
|
|
|
|
secs = secs % (hours * 60 * 60)
|
|
|
|
minutes = int(secs // 60)
|
|
|
|
minutes = secs // 60
|
|
|
|
return f"{hours}:{minutes:02d}"
|
|
|
|
return f"{hours}:{minutes:02d}h"
|
|
|
|