You can read https://code.djangoproject.com/ticket/33113 for some details 
on this issue.

On Wednesday, October 27, 2021 at 5:07:00 AM UTC-4 [email protected] wrote:

> Hi 
> I have a form field forms.DateField and widget as follows
>
> class CustomDateInput(forms.DateInput):
>     input_type = 'date'
>
> valid_from = forms.DateField(
>         label=_("Valid from"), widget=CustomDateInput(), required=False, 
> localize=True)
>
> But the date is not displayed by the browser when the language is 
> German(de). The field is rendered as follows with in:
>
> <input type="date" name="valid_from" value="25.10.2021" class="form_item" 
> id="id_valid_from">
>
> But the browser is *not display* the initial value to the user, instead 
> shows *mm/dd/yyyy* when the system language is English and *dd.mm.yyyy* 
> when the system language is German.
>
> I have also tried not passing the localize form field argument as well as 
> localize off template tag, but both didn't work. 
>
> I could resolve the issue by rending the field manually and setting the 
> date form to  yyyy-mm-dd.
>
> Is it a browser issue or as the date input supports only value in 
> yyyy-mm-dd?
>
> Python version: 3.8. 10 and django: 3.0.14
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d636fa6e-69e4-4402-9d1e-2486fb70c11cn%40googlegroups.com.

Reply via email to