Ticket #2127: filter.diff
File filter.diff, 1.0 KB (added by , 18 years ago) |
---|
-
template/defaultfilters.py
329 329 330 330 def date(value, arg=None): 331 331 "Formats a date according to the given format" 332 # Fail silently if value is None. 333 if not value: 334 return '' 332 335 from django.utils.dateformat import format 333 336 if arg is None: 334 337 arg = settings.DATE_FORMAT … … 336 339 337 340 def time(value, arg=None): 338 341 "Formats a time according to the given format" 342 # Fail silently if value is None. 343 if not value: 344 return '' 339 345 from django.utils.dateformat import time_format 340 346 if arg is None: 341 347 arg = settings.TIME_FORMAT … … 343 349 344 350 def timesince(value): 345 351 'Formats a date as the time since that date (i.e. "4 days, 6 hours")' 352 # Fail silently if value is None. 353 if not value: 354 return '' 346 355 from django.utils.timesince import timesince 347 356 return timesince(value) 348 357