Closed RuudH closed 10 years ago
What environment are you in? I see the expected return of "00:13 uur".
I'm running this on IIS 7.5 on my development VM running windows 7 64bit. I see the same results in IE11 and Chrome. Any more information you would like?
Here's a jsbin reproducing the issue. http://jsbin.com/fuvohonameka/1/edit
I had been testing with Moment.js version 2.4.0. Upgrading to the latest Moment.js (version 2.8.2) breaks quite a bit.
Not sure what the issue is, but I'm looking into it.
For the record, the breaking changes were introduced in Moment.js version 2.8.0 at the end of July. Moment Duration Format passes all tests on Moment.js version 2.7.0.
It looks like there's an error in the moment.duration.as and .asMinutes methods that was introduced in Moment.js 2.8.0..
moment.duration(12, "minutes").as("minutes");
and
moment.duration(12, "minutes").asMinutes();
// 12
moment.duration(13, "minutes").as("minutes");
and
moment.duration(13, "minutes").asMinutes();
// 12.999999999999998
This happens with moment durations of 13, 26, 27, 31, 33, 52, 54 minutes, and possibly other combinations of values and units. I have a little more digging to do before I file an issue on Moment.js.
Hi, Thanks for the information. I did not make the connection with the new moment.js. It happens in rare occations in our app so i didn't notice it directly after updating to 2.8.1. Thanks for your fast actions!!
This issue is fixed in Moment.js version 2.8.3, which was published on September 4.
Great thank you for your help and feedback!
moment.duration(13, 'minutes').format("HH:mm [uur]", { trim: false }); Will return "00:12 uur"
I would expected "00:13 uur"
Thanks!