Describe the bug
Duration.formatTo returns incoherent values for durations of more than a year.
To Reproduce
Duration.fromObject({
milliseconds: Duration.fromObject({ years: 1, months: 2, days: 3 }).as('milliseconds')
}).toFormat('yyyy MM dd hh:mm:ss');
// returns '0001 02 08 00:00:00'
// there is 5 too many days
Duration.fromObject({
milliseconds: Duration.fromObject({ years: 1, months: 2, days: 3 }).as('milliseconds')
}).shiftTo('year').toFormat('yyyy MM dd hh:mm:ss');
// returns 0001 02 02 03:17:15
// this is not even close to the expected value, from where do all those hours and minutes come from ?
Actual vs Expected behavior
The value expected from those 2 calls is 0001 02 03 00:00:00
Desktop (please complete the following information):
- OS: Windows
- Browser Chrome 141
- Luxon version 3.7.2
- Your timezone Europe/Paris
Additional context
This worked fine before version 3.4.2