Ticket #7443: timesince.diff
File timesince.diff, 1.1 KB (added by , 16 years ago) |
---|
-
django/template/defaultfilters.py
643 643 if not value: 644 644 return u'' 645 645 if arg: 646 return timesince( arg, value)646 return timesince(value, arg) 647 647 return timesince(value) 648 648 timesince.is_safe = False 649 649 -
tests/regressiontests/defaultfilters/tests.py
352 352 >>> timesince(datetime.datetime.now() - datetime.timedelta(1)) 353 353 u'1 day' 354 354 355 >>> timesince(datetime.datetime(2005, 12, 29), datetime.datetime(2005, 12, 30)) 356 u'1 day' 357 358 >>> timeuntil(datetime.datetime.now() + datetime.timedelta(1)) 359 u'1 day' 360 361 >>> timeuntil(datetime.datetime(2005, 12, 30), datetime.datetime(2005, 12, 29)) 362 u'1 day' 363 355 364 >>> default(u"val", u"default") 356 365 u'val' 357 366