Ticket #9520: datefilter_t9520_r10177.diff

File datefilter_t9520_r10177.diff, 784 bytes (added by Andrew Badr, 9 years ago)
  • django/template/defaultfilters.py

     
    673673        return u''
    674674    if arg is None:
    675675        arg = settings.DATE_FORMAT
    676     return format(value, arg)
     676    try:
     677        return format(value, arg)
     678    except AttributeError:
     679        return value
    677680date.is_safe = False
    678681
    679682def time(value, arg=None):
     
    683686        return u''
    684687    if arg is None:
    685688        arg = settings.TIME_FORMAT
    686     return time_format(value, arg)
     689    try:
     690        return time_format(value, arg)
     691    except AttributeError:
     692        return value
    687693time.is_safe = False
    688694
    689695def timesince(value, arg=None):
Back to Top