Source

django-timedelta-field / timedelta / templatetags / timedelta.py

Full commit
1
2
3
4
5
6
7
8
9
from django import template
register = template.Library()

# Don't really like using relative imports, but no choice here!
from ..helpers import nice_repr

@register.filter(name='timedelta')
def timedelta(value, display="long"):
    return nice_repr(value, display)