Skip to content

Commit

Permalink
timeuntil needs to pass the argument optionally
Browse files Browse the repository at this point in the history
  • Loading branch information
David Cramer authored and David Cramer committed Oct 27, 2009
1 parent 160d547 commit d1566ea
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions coffin/template/defaultfilters.py
Expand Up @@ -15,20 +15,18 @@ def url(view_name, *args, **kwargs):
return url._reverse(view_name, args, kwargs)

@register.filter(jinja2_only=True)
def timesince(value, arg=None):
def timesince(value, *arg):
if value is None or isinstance(value, Undefined):
return u''
from django.utils.timesince import timesince
if arg:
return timesince(value, arg)
return timesince(value)
return timesince(value, *arg)

@register.filter(jinja2_only=True)
def timeuntil(value, arg=None):
def timeuntil(value, *args):
if value is None or isinstance(value, Undefined):
return u''
from django.utils.timesince import timeuntil
return timeuntil(date, arg)
return timeuntil(value, *args)

@register.filter(jinja2_only=True)
def date(value, arg=None):
Expand Down

0 comments on commit d1566ea

Please sign in to comment.