django-bootstrap-datepicker-plus
django-bootstrap-datepicker-plus copied to clipboard
Multilanguage - format not changing
Describe the bug When using two languages that use different formats to validate a date, the widget sticks to the default (o defined) format and do not change with localization.
To Reproduce Steps to reproduce the behavior:
- Create a form with the datepicker widget (or datetimepicker widget)
- Use Localization and add language "ES" (spanish)
- try a date incompatible with both formats like: 01/30/1990
- Save form and you'll see the error of format validation.
Expected behavior
When setting "ES" as language, the format should change to format='%d/%m/%Y'
in front of the default.
Screenshots
How it shows the format when EN or ES:
How it should be on ES:
Setup Information (please complete the following information):
- Python version [3.6]
- Django version [2.1]
- Bootstrap version [4]
- jQuery version [e.g. 1.7.1]
- I18N, L10N, TZ = True on settings; tags loaded on template and
self.fields['dob'].localize = True self.fields['dob'].widget.is_localized = True
[x] I have followed the configuration instructions and checked out the common error troubleshooting page.