1
0
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:
Julien Phalip
2011-11-06 00:31:06 +00:00
parent af7688dbec
commit b2948d8179
2 changed files with 62 additions and 0 deletions

View File

@@ -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)