Duration.toISOString()
should use a set precision for seconds
#2366
Labels
Duration.toISOString()
should use a set precision for seconds
#2366
Describe the bug
Problem: The
Duration.toISOString()
will format an ISO string with arbitrary precision floating point seconds. Although the specification doesn't define the precision the seconds field should have, it would likely be better to keep to some common format. Themoment
library uses the millisecond precision, as does the JavaDuration
.I noticed this behavior when moving from
moment
. We were sending ISO durations to our Java backend and it quickly started throwing exceptions trying to parse the durations.Expected behavior
Example:
Information
The text was updated successfully, but these errors were encountered: