moment / luxon

⏱ A library for working with dates and times in JS
https://moment.github.io/luxon
MIT License
15.12k stars 728 forks source link

Fix Interval.splitAt datetime sorting #1524

Closed joshuajaco closed 9 months ago

joshuajaco commented 9 months ago

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[bot] commented 9 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

joshuajaco commented 9 months ago

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

diesieben07 commented 9 months ago

Thank you for this bug fix, @joshuajaco!