Opened 10 years ago

Closed 10 years ago

#22355 closed New feature (wontfix)

Humanize timedelta objects in templates

Reported by: Anoop Thomas Mathew Owned by:
Component: Utilities Version: dev
Severity: Normal Keywords: templates, filter, timedelta, humanize, timesince
Cc: Anoop Thomas Mathew Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

A filter for humanizing datetime.timedelta objects for templates utilizing on the timesince function already existing. Tests and Documentation included in the patch.

{{time_delta|delta}}

will give the humanized version of timedelta object. Follows the same pattern as of timesince in defaultfilters.py

Eg. 4 weeks, 2 days

Attachments (1)

timedelta_templatetag_with_tests_and_docs.diff (8.4 KB ) - added by Anoop Thomas Mathew 10 years ago.
patch for delta filter for humanizing datetime.timedelta objects with tests and docs

Download all attachments as: .zip

Change History (3)

by Anoop Thomas Mathew, 10 years ago

patch for delta filter for humanizing datetime.timedelta objects with tests and docs

comment:1 by Anoop Thomas Mathew, 10 years ago

Cc: Anoop Thomas Mathew added

comment:2 by Tim Graham, 10 years ago

Resolution: wontfix
Status: newclosed

Thanks for the contribution, but we aren't really adding more built-in filters as it's easy enough to add your custom filters based on the needs of each project.

Note: See TracTickets for help on using tickets.
Back to Top