mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Fixed #17165 -- Fixed SelectDateWidget._has_changed() to work correctly with a localized date format.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17071 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -134,3 +134,8 @@ class SelectDateWidget(Widget):
|
||||
s = Select(choices=choices)
|
||||
select_html = s.render(field % name, val, local_attrs)
|
||||
return select_html
|
||||
|
||||
def _has_changed(self, initial, data):
|
||||
input_format = get_format('DATE_INPUT_FORMATS')[0]
|
||||
data = datetime_safe.datetime.strptime(data, input_format).date()
|
||||
return super(SelectDateWidget, self)._has_changed(initial, data)
|
||||
Reference in New Issue
Block a user