1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Refs #30578 -- Made SelectDateWidget.format_value() independent of USE_L10N.

This commit is contained in:
Claude Paroz
2020-07-10 12:57:39 +02:00
committed by Mariusz Felisiak
parent 04e4f80c1f
commit 00727d384b
2 changed files with 8 additions and 4 deletions

View File

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