-
Notifications
You must be signed in to change notification settings - Fork 730
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
Regression: Duration.normalize() not working properly after 3.4.1 #1493
Comments
Exactly, just wanted to report the same! I discovered it while updating my ts-luxon.
if you confirm that both can pass at the same time. Cheers |
In a way we can just run But that feels wrong |
@thomassth no we can't rescale, because rescale calls normalize 😅 |
I apologize for the broken release again. |
@diesieben07 is there an analysis of all the use cases the algorythm should cover? |
Here is (as far as I see it) what
The previous implementations never really made this distinction clear and attempted to handle both cases in unison. As for units which are overall negative in value, they are handled the same way, except that every step is inverted. For example |
Ok that makes sense. And I saw in the code the handling of overall negative values, managed with a double |
Correct. Although I have improved this now, removing the need for multiple intermediate objects. |
**Changelog** **3.4.2 (2023-08-26)** - Fixes regression from 3.4.1 (moment/luxon#1493) **3.4.1 (2023-08-23)** - Fixes for regressions from 3.4.0 (moment/luxon#1482 and moment/luxon#1488) **3.4.0 (2023-08-08)** - Fix type checking on input zones - Fix Islamic months listing - Fix normalize() for negative inputs **3.3.0 (2023-03-03)** - Fix off-by-one in Interval#count (moment/luxon#1308) - Support formatting for custom zones (moment/luxon#1377) - Fix parsing for narrow spaces (moment/luxon#1369) - Handle leap year issue with AD 100 (moment/luxon#1390) - Allow parsing of just an offset **3.2.1 (2023-01-04)** - Fix for RFC-2822 regex vulnerability - Better handling of BCP tags with -x- extensions **3.2.0 (2022-12-29)** - Allow timeZone to be specified as an intl option - Fix for diff's handling of end-of-month when crossing leap years (moment/luxon#1340) - Add Interval.toLocaleString() (moment/luxon#1320) **3.1.1 (2022-11-28)** - Add Settings.twoDigitCutoffYear **3.1.0 (2022-10-31)** - Add Duration.rescale **3.0.4 (2022-09-24)** - Fix quarters in diffs (moment/luxon#1279) - Export package.json in package (moment/luxon#1239) **3.0.2 (2022-08-28)** - Lots of doc changes - Added DateTime.expandFormat - Added support for custom conversion matrices in Durations
**Changelog** **3.4.2 (2023-08-26)** - Fixes regression from 3.4.1 (moment/luxon#1493) **3.4.1 (2023-08-23)** - Fixes for regressions from 3.4.0 (moment/luxon#1482 and moment/luxon#1488) **3.4.0 (2023-08-08)** - Fix type checking on input zones - Fix Islamic months listing - Fix normalize() for negative inputs **3.3.0 (2023-03-03)** - Fix off-by-one in Interval#count (moment/luxon#1308) - Support formatting for custom zones (moment/luxon#1377) - Fix parsing for narrow spaces (moment/luxon#1369) - Handle leap year issue with AD 100 (moment/luxon#1390) - Allow parsing of just an offset **3.2.1 (2023-01-04)** - Fix for RFC-2822 regex vulnerability - Better handling of BCP tags with -x- extensions **3.2.0 (2022-12-29)** - Allow timeZone to be specified as an intl option - Fix for diff's handling of end-of-month when crossing leap years (moment/luxon#1340) - Add Interval.toLocaleString() (moment/luxon#1320) **3.1.1 (2022-11-28)** - Add Settings.twoDigitCutoffYear **3.1.0 (2022-10-31)** - Add Duration.rescale **3.0.4 (2022-09-24)** - Fix quarters in diffs (moment/luxon#1279) - Export package.json in package (moment/luxon#1239) **3.0.2 (2022-08-28)** - Lots of doc changes - Added DateTime.expandFormat - Added support for custom conversion matrices in Durations closes #133599 Related: odoo/enterprise#46556 Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Describe the bug
See https://github.com/moment/luxon/actions/runs/5943754818/job/16119553727
Likely the fix for #1482 in 3.4.1 (11e454c) broke #1467
To Reproduce
Duration.fromObject({ hours: 96, minutes: 0, seconds: -10 }).normalize().toObject())
should equal
{ hours: 95, minutes: 59, seconds: 50}
but no conversion happened.Actual vs Expected behavior
All tests should be passing
The text was updated successfully, but these errors were encountered: