My locale dateformat is dd/mm/yyyy and Django is requering AAAA-MM-DD
when the user inputs 04/11/2009 Django raises:
_('Enter a valid date in YYYY-MM-DD format.'))
Im using simple html input field type="text", Not forms.DateField
Thanks :)
My locale dateformat is dd/mm/yyyy and Django is requering AAAA-MM-DD
when the user inputs 04/11/2009 Django raises:
_('Enter a valid date in YYYY-MM-DD format.'))
Im using simple html input field type="text", Not forms.DateField
Thanks :)
I'm assuming you are using a forms.DateField
. If so, you need to supply a input_formats
argument like so:
class MyForm(forms.Form):
start_date = forms.DateField(input_formats=['%d/%m/%Y'])
input_formats just takes a list of the formats you want to accept.
See http://docs.djangoproject.com/en/dev/ref/forms/fields/#datefield for more information.