- Create a Model with a date field
- Create a ModelForm based on said model with a widget entry to make the
date a DateInput (otherwise it is shown as text field)
- With localization turned on set LANGUAGE='it-ch'
- Open a webpage showing the form with {{ form }} in the template
With 'it-ch' the default value is not shown because the value passed to
the field is not understood by the browser (in this case '%d/%m/%Y'),
while it is shown when using 'en-us' (in this case '%Y-%m-%d is passed)
Expected behavior:
The default date is shown independently of the locale selected server side
--
Ticket URL: <https://code.djangoproject.com/ticket/33165>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
This sounds like a browser issue and not Django's fault?
--
Ticket URL: <https://code.djangoproject.com/ticket/33165#comment:1>
* status: new => closed
* type: Uncategorized => Bug
* resolution: => needsinfo
Comment:
Thanks for the report, however I cannot reproduce this issue. Can you
provide a minimal project to reproduce?
--
Ticket URL: <https://code.djangoproject.com/ticket/33165#comment:2>
Comment (by Claude Paroz):
This is closely related to #33113. Typically, when you are using a `date`
input widget, the initial input value should be normalized to the `YYYY-
MM-DD` iso format (see https://developer.mozilla.org/en-
US/docs/Web/HTML/Element/input/date). The discussion could continue on
#33113.
--
Ticket URL: <https://code.djangoproject.com/ticket/33165#comment:3>