Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase number of allowed digits when parsing ISO duration #1213

Merged
merged 1 commit into from
May 27, 2022
Merged

Increase number of allowed digits when parsing ISO duration #1213

merged 1 commit into from
May 27, 2022

Conversation

thomas-darling
Copy link
Contributor

@thomas-darling thomas-darling commented May 27, 2022

Fixes #880.

The regex for parsing an ISO duration string restricts the number of fractional digits to 9, with the exception of fractional seconds, which is restricted to 20. However, the toISO method outputs up to 16 fractional digits, which means the output of toISO may not be parsable by fromISO.

This fix increases the number of allowed digits to 20 for all units.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 27, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: thomas-darling / name: Thomas Darling (01ad50b)

@icambron icambron merged commit bf7127d into moment:master May 27, 2022
@icambron
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duration doesn't parse its own ISO format
2 participants