From b2948d81798e78e0b3bcb016bd4efa4d66bc5d8e Mon Sep 17 00:00:00 2001 From: Julien Phalip Date: Sun, 6 Nov 2011 00:31:06 +0000 Subject: 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 --- django/forms/extras/widgets.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'django/forms') diff --git a/django/forms/extras/widgets.py b/django/forms/extras/widgets.py index 51455780f5..4fb4869e68 100644 --- a/django/forms/extras/widgets.py +++ b/django/forms/extras/widgets.py @@ -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) \ No newline at end of file -- cgit v1.3