#15267: now template tag does not recognize predefined formats
------------------------------------------------+---------------------------
Reporter: creecode@… | Owner: nobody
Status: new | Milestone:
Component: Template system | Version: 1.2
Keywords: now template tag predefined format | Triage Stage: Unreviewed
Has patch: 1 |
------------------------------------------------+---------------------------
The documentation for the now template tag <
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#now > 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...
WedAMPSTEPST0FebE_February-0800RFebAMPST
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 settings.py. 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 <
http://groups.google.com/group/django-
users/browse_thread/thread/cf80ea434c1112e8/ff21567e65d8ccf6#ff21567e65d8ccf6
>.
I have attached a patch which I believe brings the code into sync with the
docs.
--
Ticket URL: <http://code.djangoproject.com/ticket/15267>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.