You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Duration::shiftTo does not convert to years correctly. A value in milliseconds less than 1 year results in a new duration that is longer than a year.
To Reproduce
var luxon = require("luxon")
const result = luxon.Duration.fromObject({"millisecond": 31535940000});
result.shiftTo('year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond');
Actual vs Expected behavior
Actual:
{years: 1, months: 0, days: 4, hours: 23, minutes: 59, seconds: 0, milliseconds: 0}
Describe the bug
Duration::shiftTo does not convert to years correctly. A value in milliseconds less than 1 year results in a new duration that is longer than a year.
To Reproduce
Actual vs Expected behavior
Actual:
{years: 1, months: 0, days: 4, hours: 23, minutes: 59, seconds: 0, milliseconds: 0}
Expected:
According to https://github.com/moment/luxon/blob/master/docs/math.md a year is considered to be 365 days or 31536000000 milliseconds (365 * 24 * 60 * 60 * 1000).
Desktop:
The text was updated successfully, but these errors were encountered: