#3672: newforms: DateField doesn't handle date output formats
---------------------------------------------------------------+------------
Reporter: [EMAIL PROTECTED] |
Owner: nobody
Status: new |
Component: django.newforms
Version: SVN |
Resolution:
Keywords: DateField l10n localization format input output |
Stage: Accepted
Has_patch: 1 |
Needs_docs: 0
Needs_tests: 1 |
Needs_better_patch: 1
---------------------------------------------------------------+------------
Comment (by [EMAIL PROTECTED]):
Note that these widgets take a Django style format string like 'N j, Y'
versus Python strftime() style like '%b %d, %Y'.
It means you could have a field definition with two different styles of
date format strings like:
{{{
#!python
class MyForm(forms.Form):
start_date = forms.DateField(widget=DateTextInput(format='d/m/y'),
input_formats=('%d/%m/%y',))
}}}
However, I think it makes sense to use Django format strings for output
since it is used elsewhere in the UI and is perhaps more powerful.
DateField uses strftime() patterns for input, but it is parsing using
strptime() so that's the natural format.
--
Ticket URL: <http://code.djangoproject.com/ticket/3672#comment:9>
Django Code <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
-~----------~----~----~----~------~----~------~--~---