Opened 9 years ago

Closed 9 years ago

#3556 closed (wontfix)

date & time filters use settings.DATE_FORMAT & settings.TIME_FORMAT, should use i18n

Reported by: ludvig.ericson@… Owned by: adrian
Component: Template system Version: master
Severity: Keywords: date time i18n
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In django/template/defaultfilters.py, date and time functions (filters) both use a specific setting for their default value.
I think this is wrong, at least what the default value specifies, because when i18n is loaded, it's impossible to change what these output without giving an argument to the filters.

Supplied patch makes both filters use whatever DATE_FORMAT and TIME_FORMAT translate into, which I think seems to be the correct value, as it changes depending on user preference.

Attachments (1)

defaultfilters.py.diff (562 bytes) - added by ludvig.ericson@… 9 years ago.
Patch for defaultfilters.py

Download all attachments as: .zip

Change History (2)

Changed 9 years ago by ludvig.ericson@…

Patch for defaultfilters.py

comment:1 Changed 9 years ago by jacob

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

Unfortunately, this would make it impossible to change the default date format without changing the language. Although the two are usually related, they're not always.

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