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

Fix Interval.splitAt datetime sorting #1524

Merged
merged 1 commit into from Oct 14, 2023
Merged

Fix Interval.splitAt datetime sorting #1524

merged 1 commit into from Oct 14, 2023

Conversation

joshuajaco
Copy link
Contributor

@joshuajaco joshuajaco commented Oct 10, 2023

Interval#splitAt is incorrectly sorting the input DateTimes by ISO strings (Array.sort implicitly calls toString), which leads to invalid intervals when trying to split at DST shifted hours.
This PR changes the sorting to use the underlying epoch milliseconds instead.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 10, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: joshuajaco / name: Joshua Jacobowitz (df8e30d)

@joshuajaco joshuajaco marked this pull request as ready for review October 10, 2023 13:07
@joshuajaco
Copy link
Contributor Author

@icambron anything I can do to get this merged?
This is currently preventing us from using splitAt

@diesieben07 diesieben07 merged commit c8a8fa2 into moment:master Oct 14, 2023
2 checks passed
@diesieben07
Copy link
Collaborator

Thank you for this bug fix, @joshuajaco!

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.

None yet

2 participants