Ticket #2053: timeslice.diff
File timeslice.diff, 939 bytes (added by , 18 years ago) |
---|
-
django/template/defaultfilters.py
341 341 arg = settings.TIME_FORMAT 342 342 return time_format(value, arg) 343 343 344 def timesince(value ):344 def timesince(value, arg=None): 345 345 'Formats a date as the time since that date (i.e. "4 days, 6 hours")' 346 346 from django.utils.timesince import timesince 347 return timesince(value) 347 if arg: 348 return timesince(arg, value) 349 else: 350 return timesince(value) 348 351 352 def timeuntil(value, arg=None): 353 'Formats a date as the time until that date (i.e. "4 days, 6 hours")' 354 from django.utils.timesince import timeuntil 355 if arg: 356 return timeuntil(arg, value) 357 else: 358 return timeuntil(value) 359 360 349 361 ################### 350 362 # LOGIC # 351 363 ###################