Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix normalize() to handle partially negative inputs #1467

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

thomassth
Copy link
Contributor

@thomassth thomassth commented Jul 14, 2023

Continuing 1b73593

Fix #1233 as well as #781 (comment)

Values like { hours: 96, minutes: 0, seconds: -10 } will be normalized to { hours: 95, minutes: 59, seconds: 50 }

This behavior is consistent with rescale()

Test case provided as per #1296 (comment)

@thomassth thomassth changed the title Normalize patch Fix normalize() to handle partially negative inputs Jul 14, 2023
@icambron icambron merged commit 2411f6e into moment:master Aug 9, 2023
@icambron
Copy link
Member

icambron commented Aug 9, 2023

@thomassth thanks!

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

Successfully merging this pull request may close these issues.

Duration#normalize has trouble with negative milliseconds
2 participants