Opened 9 years ago

Closed 9 years ago

#13289 closed (fixed)

datetime filter

Reported by: zach Owned by: nobody
Component: Template system Version: 1.1
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In addition to the date filter which by default formats to settings.DATE_FORMAT, there should be a datetime filter which formats to settings.DATETIME_FORMAT.

Change History (1)

comment:1 Changed 9 years ago by Ramiro Morales

Resolution: fixed
Status: newclosed

Yo can pass Python datetimes to the date filter, and if you use a format string containing time of day format specifiers you can get a complete date+time representation.

If you need to use a predefined format specification like DATETIME_FORMAT then the new in 1.2 l10n machinery allows you to use format strings defined per-locale and fallback to settings values like settings.DATETME_FORMAT. Read the relevant docs for more details.

This won't be backported to the 1.1.X branch where no new feature can be added so if are using 1.1 you need to use the DATETIME_FORMAT I'd advise you to plan porting you application to 1.2.

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