moment / luxon

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

normalize() handles partially negative inputs properly #1456

Closed thomassth closed 1 year ago

thomassth commented 1 year ago

Continuing https://github.com/moment/luxon/pull/1296/commits/1b735939d319990e53ed440aaa3a41456488c960

Fix #1233 as well as https://github.com/moment/luxon/issues/781#issuecomment-1008051278

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 comment in 1296.

thomassth commented 1 year ago

test https://github.com/apps/linux-foundation-easycla

thomassth commented 1 year ago

test2 @linux-foundation-easycla

thomassth commented 1 year ago

fyi new tests passed https://github.com/thomassth/luxon/actions/runs/5465741213