[Django] #30803: Dateparse function should support comma separators for milliseconds according to ISO-8601

15 views
Skip to first unread message

Django

unread,
Sep 25, 2019, 4:24:22 PM9/25/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
-----------------------------------------+------------------------
Reporter: benwilber | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 2.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Presently the regex for parsing ISO-8601 formatted datetimes in
django.utils.dateparse.parse_time and parse_datetime only supports period
(.) separators for milliseconds.

Examples:

2014-08-06T11:00:00.000Z

2014-08-06T11:00:00,000Z


ISO 8601:2004 states that parsers should support both delineators, with a
preference for commas. https://www.iso.org/standard/40874.html


A decimal mark, either a comma or a dot (without any preference as stated
in resolution 10 of the 22nd General Conference CGPM in 2003,[16] but with
a preference for a comma according to ISO 8601:2004)


Github Pull Request: https://github.com/django/django/pull/11818

--
Ticket URL: <https://code.djangoproject.com/ticket/30803>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 25, 2019, 4:34:59 PM9/25/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
----------------------------+--------------------------------------
Reporter: Ben Wilber | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Changes (by Ben Wilber):

* type: Uncategorized => Bug
* version: 2.2 => master
* component: Uncategorized => Utilities


--
Ticket URL: <https://code.djangoproject.com/ticket/30803#comment:1>

Django

unread,
Sep 25, 2019, 4:42:24 PM9/25/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
-----------------------------+------------------------------------

Reporter: Ben Wilber | Owner: nobody
Type: New feature | Status: new

Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by Simon Charette):

* has_patch: 0 => 1
* type: Bug => New feature
* stage: Unreviewed => Accepted


Comment:

I don't see much harm in supporting comma separators but I couldn't get my
hand on a copy of `ISO 8601:2004` to confirm the report. Tentatively
accepting.

Are you aware in any changes in `ISO 8601-1:2019` and `ISO 8601-2:2019`
given they supersede the now withdrawn `ISO 8601:2004`?

It might be worth adding a mention in the release notes about this change
even if it's minor.

--
Ticket URL: <https://code.djangoproject.com/ticket/30803#comment:2>

Django

unread,
Sep 30, 2019, 4:32:46 PM9/30/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
-----------------------------+------------------------------------
Reporter: Ben Wilber | Owner: nobody
Type: New feature | Status: new
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Ben Wilber):

Replying to [comment:2 Simon Charette]:


> I don't see much harm in supporting comma separators but I couldn't get
my hand on a copy of `ISO 8601:2004` to confirm the report. Tentatively
accepting.
>
> Are you aware in any changes in `ISO 8601-1:2019` and `ISO 8601-2:2019`
given they supersede the now withdrawn `ISO 8601:2004`?
>
> It might be worth adding a mention in the release notes about this
change even if it's minor.


I'm not aware of anything in the 2019 revisions that has changed regarding
periods vs commas for separating milliseconds. Unfortunately the full
specs are not publicly available to confirm. I can add a note to the
release notes. Which would be the appropriate release notes document to
mention this?

--
Ticket URL: <https://code.djangoproject.com/ticket/30803#comment:3>

Django

unread,
Oct 1, 2019, 7:09:14 AM10/1/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
-----------------------------+--------------------------------------
Reporter: Ben Wilber | Owner: Ben Wilber
Type: New feature | Status: assigned

Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by felixxm):

* status: new => assigned
* owner: nobody => Ben Wilber
* needs_tests: 0 => 1
* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30803#comment:4>

Django

unread,
Nov 20, 2019, 10:35:09 PM11/20/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
-----------------------------+--------------------------------------
Reporter: Ben Wilber | Owner: Ben Wilber
Type: New feature | Status: assigned
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------

Comment (by Farhaan Bukhsh):

Hey, I would love to complete this PR, what can be the next steps? I see
writing tests as one of them. Thanks a ton in advance. :)

--
Ticket URL: <https://code.djangoproject.com/ticket/30803#comment:5>

Django

unread,
Nov 25, 2019, 6:48:55 AM11/25/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
-----------------------------+------------------------------------------
Reporter: Ben Wilber | Owner: Farhaan Bukhsh

Type: New feature | Status: assigned
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------------
Changes (by felixxm):

* owner: Ben Wilber => Farhaan Bukhsh
* needs_tests: 1 => 0


Comment:

[https://github.com/django/django/pull/12141 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/30803#comment:6>

Django

unread,
Nov 27, 2019, 2:54:40 AM11/27/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
-----------------------------+---------------------------------------------

Reporter: Ben Wilber | Owner: Farhaan Bukhsh
Type: New feature | Status: assigned
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by felixxm):

* needs_docs: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/30803#comment:7>

Django

unread,
Nov 27, 2019, 3:45:11 AM11/27/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
-----------------------------+---------------------------------------------
Reporter: Ben Wilber | Owner: Farhaan Bukhsh
Type: New feature | Status: assigned
Component: Utilities | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"42b23d1e79b21ddd8abd7216a6771f105dd7062c" 42b23d1e]:
{{{
#!CommitTicketReference repository=""
revision="42b23d1e79b21ddd8abd7216a6771f105dd7062c"
Refs #30803 -- Allowed comma separators for decimal fractions in
parse_duration().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30803#comment:8>

Django

unread,
Nov 27, 2019, 3:45:12 AM11/27/19
to django-...@googlegroups.com
#30803: Dateparse function should support comma separators for milliseconds
according to ISO-8601
-----------------------------+---------------------------------------------
Reporter: Ben Wilber | Owner: Farhaan Bukhsh
Type: New feature | Status: closed
Component: Utilities | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"1f817daa20110987bf155fc6c942a8a14720a66b" 1f817daa]:
{{{
#!CommitTicketReference repository=""
revision="1f817daa20110987bf155fc6c942a8a14720a66b"
Fixed #30803 -- Allowed comma separators for milliseconds in
django.utils.dateparse functions.

Co-Authored-By: Ben Wilber <benw...@gmail.com>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30803#comment:9>

Reply all
Reply to author
Forward
0 new messages