#30141: dateparse parse_duration to accept negative durations
-------------------------------+--------------------------------------
Reporter: heikkimattila | Owner: nobody
Type: Bug | Status: new
Component: Utilities | Version: 1.11
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 heikkimattila):
* status: closed => new
* resolution: needsinfo =>
Comment:
Example cases, can be discussed:
parse_duration('-00:01:01') => plus 61 seconds, so it is not -(00:01:01)
but (-00):(+01):(+01)
**parse_duration('00:-01:-01) => None , leading zeros will prevent
parsing**
parse_duration('-01:01') => minus 59 seconds
parse_duration('-01:-01') => minus 61 seconds
The fix presented would allow the second line to be parsed (which would
help with generated durations).
And some instructions in the function/documentation/wiki would be useful,
to clarify how the minus sign affects in duration.
--
Ticket URL: <https://code.djangoproject.com/ticket/30141#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/071.c9c8d9fa3302ae59d6a8bb8fb7c569d4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.