check the DateField form widget. It allows you to specify what format
the date should be in.
http://docs.djangoproject.com/en/dev/ref/forms/fields/#datefield
adi
Hi Adi, thanks for your reply!
I had just tried the DateField.input_formats, but the problem was that
I'm using the date admin widgets.
If I specify input_formats like: '%d.%m.%y', I can't use the admin
widgets 'cause it insert the date in the format: '%Y-%m-%d' (how you
can see in django/contrib/admin/media/js/admin/DateTimeShortcuts.js
line 239)...
Thanks for your replies, Koeb and Ady.
Ady, if I understood I've to place the code from
http://code.djangoproject.com/attachment/ticket/3672/ticket%233672--patch-test.diff
to
- python/site-packages/django/forms/forms.py and
- python/site-packages/django/forms/widgets.py
and then I call the form with the follow field:
date = forms.DateField(widget=DateTextInput(format='d/m/y'),
input_formats=['%d/%m/%y'])
It's correct?