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
negative ISO8601 duration strings are not handled properly.
const durationString = dayjs.duration(-1000).toISOString(); //Results in -PT1S
expect(durationString).toEqual('-PT1S');
const actual = dayjs.duration(durationString);
expect(actual.asSeconds()).toEqual(-1); // this fails !!! results in +1
Expected behavior
Solution 1
toISOString should apply negative sign to the numeric portions of the string ( for the above eg it should return PT-1S)
Solution 2
duration should handle leading negative sign as a negative duration. ( for the above example asSeconds should return -1)
Describe the bug
negative ISO8601 duration strings are not handled properly.
Expected behavior
Solution 1
toISOString should apply negative sign to the numeric portions of the string ( for the above eg it should return PT-1S)
Solution 2
duration should handle leading negative sign as a negative duration. ( for the above example asSeconds should return -1)
Relates to
#1700
Information
The text was updated successfully, but these errors were encountered: