Monday, August 13, 2012

Re: Django: How to get American date format in a form?

On 13-8-2012 22:41, Melvyn Sopacua wrote:
> On 13-8-2012 17:40, houmie wrote:
>
>> Its just a bit odd that templates show 11:15 p.m. Slight difference in
>> the formatting. Also the dates within templates are defined like Aug
>> 13, 2012. Doesn't confirm with my definition in formats.py.
>> Are they stored somewhere else?
>
> No, but you need the localize filter or tag:
> <https://docs.djangoproject.com/en/1.4/topics/i18n/formatting/#controlling-localization-in-templates>

Wait, if this is the same data from the model, then you need to change
the DATE_FORMAT. DATE_INPUT_FORMAT is for form fields, since the form
field needs to be able to change it back to a format that python's
datetime.date will understand. DATE_FORMAT is used for plain output.

--
Melvyn Sopacua

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate