diff options
| author | Claude Paroz <claude@2xlibre.net> | 2020-07-10 12:57:39 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-07-10 13:00:37 +0200 |
| commit | 00727d384be3c98acb46d3913bd9cc460af08582 (patch) | |
| tree | 6ce270985237eef65cabeb90c1677d5ff0c9e7ad /django/forms/widgets.py | |
| parent | 04e4f80c1fe9b5ad73c982746e4ccee3bd0d803e (diff) | |
Refs #30578 -- Made SelectDateWidget.format_value() independent of USE_L10N.
Diffstat (limited to 'django/forms/widgets.py')
| -rw-r--r-- | django/forms/widgets.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py index 177ae57f24..b1c612c26a 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -8,7 +8,6 @@ import warnings from collections import defaultdict from itertools import chain -from django.conf import settings from django.forms.utils import to_current_timezone from django.templatetags.static import static from django.utils import datetime_safe, formats @@ -1028,7 +1027,7 @@ class SelectDateWidget(Widget): # Convert any zeros in the date to empty strings to match the # empty option value. year, month, day = [int(val) or '' for val in match.groups()] - elif settings.USE_L10N: + else: input_format = get_format('DATE_INPUT_FORMATS')[0] try: d = datetime.datetime.strptime(value, input_format) |
