#35314: Django 5 breaks value of Date field rendering correctly in template
---------------------------+--------------------------------------
     Reporter:  Michael    |                    Owner:  nobody
         Type:  Bug        |                   Status:  closed
    Component:  Forms      |                  Version:  5.0
     Severity:  Normal     |               Resolution:  duplicate
     Keywords:  form date  |             Triage Stage:  Unreviewed
    Has patch:  0          |      Needs documentation:  0
  Needs tests:  0          |  Patch needs improvement:  0
Easy pickings:  0          |                    UI/UX:  0
---------------------------+--------------------------------------
Comment (by Michael):

 Hi Natalia, thanks for the comment, I am using it like this (which used to
 work in Django 4):

 {{{
 class FooForm(forms.ModelForm):
     class Meta:
         model = Foo
         exclude = [...]
         widgets = {
               `'bar_date': forms.DateInput(attrs={'type':'date'}),`
         }
 }}}

 But I made the following changes to do it working:
               `'bar_date': forms.DateInput(format='%Y-%m-%d',
 attrs={'type':'date'}),`

 Seems a bit counter intuitive to have a broken date input format by
 default.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35314#comment:7>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e52bec407-ff6f664c-7c3f-488a-abcb-c230327276cd-000000%40eu-central-1.amazonses.com.

Reply via email to