Closed tiberiuzuld closed 1 year ago
Yeah, we fixed some bugs in the unit normalizer in 3.4.2. The current behavior looks unambiguously correct to me:
3 * 12 * 30 * 24 * 60 * 60 +
2 * 30 * 24 * 60 * 60 +
17 * 24 * 60 * 60 +
10 * 60 * 60 +
59 * 60 +
4 //=> 100004344
Describe the bug Duration calculation from a large number of seconds gives different result in >=3.4.2
To Reproduce const tokens = ['years', 'months', 'days', 'hours', 'minutes', 'seconds']; luxon.Duration.fromObject({seconds: 100004344}).shiftTo(...tokens).toHuman(); -> '3 years, 2 months, 17 days, 10 hours, 59 minutes, 4 seconds'
Actual vs Expected behavior Expected behavior in <3.4.2 const tokens = ['years', 'months', 'days', 'hours', 'minutes', 'seconds']; luxon.Duration.fromObject({seconds: 100004344}).shiftTo(...tokens).toHuman(); -> '3 years, 2 months, 2 days, 10 hours, 59 minutes, 4 seconds'
Desktop (please complete the following information):
Additional context Add any other context about the problem here.