Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add parsing negative components in durations when ISO 8601 #2955
This is to resolve issue #2408 where formats such as 'P-6D' were not supported for durations. It supports negating each component of the duration. If the whole duration has already been negated (-P6D -> -6 days), then it will make the component positive ('-P-6D' -> 6 days). The issue showed "-P-6H+3M" as an example, but the lack of a 'T' does not fit with the rest of the standard. In light of this, the changes allow for "-PT-6H+3M" instead.
I'm not sure I understand what you mean by how the durations should be added in this context. Are you referring to the order the components are added to a moment so that proper bubbling occurs?
Are there other, larger changes that must be made before this issue can be addressed?