moment does parse ISO-formatted durations out of the box with the moment.duration
method:
moment.duration('P1Y2M3DT4H5M6S')
The regex is gnarly, but supports a number of edge cases and is pretty thoroughly tested.
moment does parse ISO-formatted durations out of the box with the moment.duration
method:
moment.duration('P1Y2M3DT4H5M6S')
The regex is gnarly, but supports a number of edge cases and is pretty thoroughly tested.