Ticket #1052: timesince_weeks.diff

File timesince_weeks.diff, 609 bytes (added by freakboy@…, 10 years ago)

Patch to add 'weeks' fidelity to timesince/timeuntil

  • django/utils/timesince.py

     
    1111    chunks = (
    1212      (60 * 60 * 24 * 365, lambda n: ngettext('year', 'years', n)),
    1313      (60 * 60 * 24 * 30, lambda n: ngettext('month', 'months', n)),
     14      (60 * 60 * 24 * 7, lambda n : ngettext('week', 'weeks', n)),
    1415      (60 * 60 * 24, lambda n : ngettext('day', 'days', n)),
    1516      (60 * 60, lambda n: ngettext('hour', 'hours', n)),
    1617      (60, lambda n: ngettext('minute', 'minutes', n))
Back to Top