summaryrefslogtreecommitdiff
path: root/django/utils/dateparse.py
diff options
context:
space:
mode:
authorFarhaan Bukhsh <farhaan.bukhsh@gmail.com>2019-09-25 16:17:22 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-11-27 09:43:12 +0100
commit1f817daa20110987bf155fc6c942a8a14720a66b (patch)
treec35dcbb922f6544b68859202a3e34d6a745a1bc0 /django/utils/dateparse.py
parent42b23d1e79b21ddd8abd7216a6771f105dd7062c (diff)
Fixed #30803 -- Allowed comma separators for milliseconds in django.utils.dateparse functions.
Co-Authored-By: Ben Wilber <benwilber@gmail.com>
Diffstat (limited to 'django/utils/dateparse.py')
-rw-r--r--django/utils/dateparse.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/utils/dateparse.py b/django/utils/dateparse.py
index 535655561c..0945c0c761 100644
--- a/django/utils/dateparse.py
+++ b/django/utils/dateparse.py
@@ -16,13 +16,13 @@ date_re = _lazy_re_compile(
time_re = _lazy_re_compile(
r'(?P<hour>\d{1,2}):(?P<minute>\d{1,2})'
- r'(?::(?P<second>\d{1,2})(?:\.(?P<microsecond>\d{1,6})\d{0,6})?)?'
+ r'(?::(?P<second>\d{1,2})(?:[\.,](?P<microsecond>\d{1,6})\d{0,6})?)?'
)
datetime_re = _lazy_re_compile(
r'(?P<year>\d{4})-(?P<month>\d{1,2})-(?P<day>\d{1,2})'
r'[T ](?P<hour>\d{1,2}):(?P<minute>\d{1,2})'
- r'(?::(?P<second>\d{1,2})(?:\.(?P<microsecond>\d{1,6})\d{0,6})?)?'
+ r'(?::(?P<second>\d{1,2})(?:[\.,](?P<microsecond>\d{1,6})\d{0,6})?)?'
r'(?P<tzinfo>Z|[+-]\d{2}(?::?\d{2})?)?$'
)
@@ -33,7 +33,7 @@ standard_duration_re = _lazy_re_compile(
r'((?:(?P<hours>\d+):)(?=\d+:\d+))?'
r'(?:(?P<minutes>\d+):)?'
r'(?P<seconds>\d+)'
- r'(?:\.(?P<microseconds>\d{1,6})\d{0,6})?'
+ r'(?:[\.,](?P<microseconds>\d{1,6})\d{0,6})?'
r'$'
)