Code

Opened 4 years ago

Closed 4 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: UI/UX:

Description

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.

Attachments (0)

Change History (1)

comment:1 Changed 4 years ago by ramiro

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to fixed
  • Status changed from new to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.