Add support for ASP.NET style time spans #2469
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The goal of this PR is to extend the Duration plugin so that it will support parsing strings in ASP.NET style time spans.
It can now parse the string in the following formats:
The format is an hour, minute, second string separated by colons like 23:59:59. The number of days can be prefixed with a dot or space separator like 7.23:59:59 or 7 23:59:59. Partial seconds are supported as well 23:59:59.999.
As of version 2.1.0,
momentjs
supports this format https://momentjs.com/docs/#/durations/:~:text=As%20of%202.1.0%2C%20moment%20supports%20parsing%20ASP.NET%20style%20time%20spans.%20The%20following%20formats%20are%20supported.