Django

Code

Changeset 6468

Show
Ignore:
Timestamp:
10/08/07 15:53:23 (1 year ago)
Author:
ubernostrum
Message:

0.91-bugfixes: Backport silent failure of date-related template filters

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/0.91-bugfixes/django/core/template/defaultfilters.py

    r2471 r6468  
    330330def date(value, arg=DATE_FORMAT): 
    331331    "Formats a date according to the given format" 
     332    if not value: 
     333        return '' 
    332334    from django.utils.dateformat import format 
    333335    return format(value, arg) 
     
    335337def time(value, arg=TIME_FORMAT): 
    336338    "Formats a time according to the given format" 
     339    if not value: 
     340        return '' 
    337341    from django.utils.dateformat import time_format 
    338342    return time_format(value, arg) 
     
    340344def timesince(value): 
    341345    'Formats a date as the time since that date (i.e. "4 days, 6 hours")' 
     346    if not value: 
     347        return '' 
    342348    from django.utils.timesince import timesince 
    343349    return timesince(value)