Open jacobg opened 3 years ago
Just looking out of interest. This is handled by _parse_iso8601_duration.
The number of digits after the decimal marker is unlimited in the regex to capture minutes:
but is assumed to be a single digit when converting it to seconds (dividing by 10
rather than taking the number of digits into account) so it's putting 4.8 minutes into the seconds part instead of 0.48 minutes.
Also, these values are then passed to the Duration
class, which has its own normalization of days/hours/minutes/seconds as well:
e.g. this works as expected:
>>> pendulum.Duration(minutes=16.48)
Duration(minutes=16, seconds=28, microseconds=800000)
So maybe _parse_iso8601_duration
can be simplified
The first two cases above have the correct output. The third one is not correct.