#22355 closed New feature (wontfix)

Humanize timedelta objects in templates

Reported by: atmb4u Owned by:
Component: Utilities Version: master
Severity: Normal Keywords: templates, filter, timedelta, humanize, timesince
Cc: atmb4u 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 atmb4u 12 months ago.
patch for delta filter for humanizing datetime.timedelta objects with tests and docs

Download all attachments as: .zip

Change History (3)

Changed 12 months ago by atmb4u

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

comment:1 Changed 12 months ago by atmb4u

  • Cc atmb4u added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 12 months ago by timo

  • Resolution set to wontfix
  • Status changed from new to closed

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