#31595: models.Datefield being localized where it shouldn't
               Reporter:             |          Owner:  nobody
  akshaysalunke13                    |
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  2.2
  Internationalization               |       Keywords:  DateField, chrome,
               Severity:  Normal     |  date, format
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
 So, I have a DateField in my model and have also set I18N & L10N to `True`
 in settings. When a browser running `en-AU` locale visits the website,
 Django tries to parse the value read from model, using the first value in
 `DATE_INPUT_FORMATS` from /conf.

 The bug is when a user in `en-AU` locale visits the website, Django reads
 the Datefield value from model and tries to localize it for `en-AU` locale
 (from `DATE_INPUT_FORMATS` in /conf/en_AU) to this format `'%d/%m/%Y'`,
 but html5 requires the `value` for `<input type="date">` to be explicitly
 in this format: yyyy-MM-dd. [ref](https://developer.mozilla.org/en-
 US/docs/Web/HTML/Element/input/date) [ref2](https://developer.mozilla.org

 This causes an error in chrome dev console and the HTML date field
 rendered without the date read from the model.[[Image(https://user-

 **This bug goes away when I disable L10N in settings. I am able to
 reproduce this bug in `en-AU` and `en-GB`**

Ticket URL: <https://code.djangoproject.com/ticket/31595>
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 

Reply via email to