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
Expected behavior
The negative sign should bubble up to the highest unit. It should return then: l{$d: Object{years: 0, months: 0, days: 0, hours: 0, minutes: -1, seconds: 1, milliseconds: 1}, $l: 'en', $ms: -61001}
because:
-1 * 60 * 1000 + 1 * 1000 + 1 = -61000
Especially, when formatting a negative value, you will get something like "-01:-01:-1" where "-01:01:1" was expected.
Information
Day.js Version [e.g. v1.10.6]
OS: [e.g. Chrome Windows]
Browser [e.g. chrome 62]
This issue is related to #1317 but seems to only partially solve this
The text was updated successfully, but these errors were encountered:
Describe the bug
const d = dayjs.duration(-61001) console.log(d) // prints: l{$d: Object{years: 0, months: 0, days: 0, hours: 0, minutes: -1, seconds: -1, milliseconds: -1}, $l: 'en', $ms: -61001}
Expected behavior
The negative sign should bubble up to the highest unit. It should return then:
l{$d: Object{years: 0, months: 0, days: 0, hours: 0, minutes: -1, seconds: 1, milliseconds: 1}, $l: 'en', $ms: -61001}
because:
-1 * 60 * 1000 + 1 * 1000 + 1 = -61000
Especially, when formatting a negative value, you will get something like "-01:-01:-1" where "-01:01:1" was expected.
Information
This issue is related to #1317 but seems to only partially solve this
The text was updated successfully, but these errors were encountered: