Closed oluckyman closed 6 years ago
Thank you! This is happening because of the rounding inherent in toLocaleString. I'll check it out.
Similarly failing:
moment.duration({ hours: 2, seconds: -30 }).format("h:mm"); // "1:60"
moment.duration(7170, "seconds").format("h:mm"); // "1:60"
moment.duration(2879, "minutes").format("d[d] h[h]"); // "1d 24h"
moment.duration(335, "hours").format("w[w], d[d]"); // "1w, 7d"
moment.duration({ days: 7, seconds: -30 }).format("w[w] d[d] h:mm", { trim: "all" }); // "6d 23:60"
Also happens with useSignificantDigits:
moment.duration({ hours: 2, seconds: -60 }).format("h:mm", { precision: 2, useSignificantDigits: true });
// 1:60