From f0cd656ee085863d3a37f1bfb8351486428b4df2 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Wed, 22 Dec 2010 00:44:54 +0000 Subject: [PATCH] Fixed #14933 -- Added ability to SelectDateWidget to cope with new alternative month names added in [14900]. Thanks, alek and Claude Peroz. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15017 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/extras/widgets.py | 2 +- tests/regressiontests/i18n/tests.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/django/forms/extras/widgets.py b/django/forms/extras/widgets.py index 7d05942f43..8f13ed6c62 100644 --- a/django/forms/extras/widgets.py +++ b/django/forms/extras/widgets.py @@ -77,7 +77,7 @@ class SelectDateWidget(Widget): escaped = True elif char in 'Yy': output.append(year_html) - elif char in 'bFMmNn': + elif char in 'bEFMmNn': output.append(month_html) elif char in 'dj': output.append(day_html) diff --git a/tests/regressiontests/i18n/tests.py b/tests/regressiontests/i18n/tests.py index 5823408bce..0a6f621e3c 100644 --- a/tests/regressiontests/i18n/tests.py +++ b/tests/regressiontests/i18n/tests.py @@ -341,6 +341,14 @@ class FormattingTests(TestCase): finally: deactivate() + # Russian locale (with E as month) + activate('ru') + self.assertEqual( + u'\n\n', + SelectDateWidget(years=range(2009, 2019)).render('mydate', datetime.date(2009, 12, 31)) + ) + deactivate() + # English locale settings.USE_L10N = True