When moment.duration is "604800000" it shows 1 week, but when moment.duration is "604800100", it shows 0 seconds instead of 1 week, 0 days, 0 hours, 0 minutes and 1 second.
const moment = require("moment");
require("moment-duration-format");
moment.updateLocale('en', {
durationLabelsStandard: {
s: "second",
ss: "seconds",
m: "minute",
mm: "minutes",
h: "hour",
hh: "hours",
d: "day",
dd: "days",
w: "week",
ww: "weeks",
M: "month",
MM: "moths",
y: "year",
yy: "years"
},
})
const duration = moment.duration("3660000").format(`y __, M __, w __, d __, h __, m __ [and] s __`);
console.log(duration)
When
moment.duration is "604800000"
it shows 1 week, but whenmoment.duration is "604800100"
, it shows 0 seconds instead of 1 week, 0 days, 0 hours, 0 minutes and 1 second.