Opened 5 years ago

Closed 5 years ago

#15267 closed (duplicate)

now template tag does not recognize predefined formats

Reported by: creecode@… Owned by: nobody
Component: Template system Version: 1.2
Severity: Keywords: now template tag predefined format
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The documentation for the now template tag < > says in part...

Given format can be one of the predefined ones DATE_FORMAT, DATETIME_FORMAT, SHORT_DATE_FORMAT or SHORT_DATETIME_FORMAT, or a custom format, same as the date filter.

I tried...

{% now "DATE_FORMAT" %}

...and get back...


The predefined format has been processed as a custom format. I have USE_I18N and USE_L10N set to True, and
LANGUAGE_CODE is 'en-us' in This is happening with Django 1.2.4, 1.2.5 and appears to effect trunk.

It appears from a quick glance at the source that the NowNode has no code in place to process the predefined formats.

Here is my initial query about this problem on django users < >.

I have attached a patch which I believe brings the code into sync with the docs.

Attachments (1)

django_now_template_tag.diff (775 bytes) - added by creecode@… 5 years ago.

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by creecode@…

comment:1 Changed 5 years ago by creecode@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Sorry for the confusion folks. danielr already created ticket #15263 for this problem during the time (usually 24 hrs or more) I like to wait for potential responses to my initial post before proceeding. I failed to check once again after doing so yesterday to see if I could find a ticket related to this issue. danielr hadn't indicated in the user group thread that he was going to create a ticket.

comment:2 Changed 5 years ago by danielr

  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top