#21556: Date field shows in changed_data due to different format
----------------------------+--------------------
     Reporter:  anonymous   |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:  Forms       |    Version:  1.6
     Severity:  Normal      |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0           |      UI/UX:  0
----------------------------+--------------------
 For a form, DateField can accept multiple formats, e.g. I can set


 {{{
 form['mydate'].input_formats = ('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y')
 }}}


 And if I post


 {{{
 form.data = {'mydate': '01/15/2013'}
 }}}


 The form will happily accepts the format.

 However, if the date did not really change:

 {{{

 form.initial = {'mydate': '2013-01-15'}
 form.data = {'mydate': '01/15/2013'}

 }}}

 'mydate' will show up in form.changed_data, because
 widgets.DateInput._format_value can only use one format, there's no way to
 make the widget recognize multiple formats.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/21556>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.4e0a7ef3a8b35448dcee1626dd34b5d9%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to