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
constmoment=require('moment');constmomentDurationFormat=require("moment-duration-format")constendDate=moment('2022-03-18');conststartDate=moment('2021-11-16');constduration=moment.duration(endDate.diff(startDate));console.log(duration.asDays());console.log(duration.format("M __ D __",{trim: 'all'}));
The output is:
121.95833333333333
"4 months -0 days"
This is the case in moment-duration-format v2.3.2.
In this code for example:
The output is:
This is the case in moment-duration-format v2.3.2.
I can work around this like so:
Effectively, the missing hour due to the daylight savings time change is causing a -0 to show up in the duration format.
The text was updated successfully, but these errors were encountered: