Closed christheyounger closed 6 years ago
Workaround: moment.duration.fn.format.defaults.decimalSeparator = ':';
Closing this. FIxed in 89839039b7995d6d0a05a758f356a53dd5fd5943.
This issue was fixed by removing the decimalSeparator
option and the defaultDecimalSeparator
function that caused the issue. Decimal separators are now rendered via toLocaleString
.
Yeah, but now when I run moment.duration(928515).format()
I get "15.00:29.00"
That's a hell of a format
You must have something changed in the default settings? With a test page that was loaded from close to the head of master on github, I see something reasonable...
moment.duration(928515).format();
//"15:29"
Please see this codepen:
https://codepen.io/darkbluesun/pen/MrygQZ
15.00:29.00
in IE10
I'm happy for you to fork and fix it if I've done something wrong
@darkbluesun It looks like IE10 doesn't have full support for toLocaleString
, which is used to format numbers in version 2 of the plugin.
Would a polyfill work for you? There look to be a few, but I haven't checked out what options they support. minimumIntegerDigits
, minimumFractionDigits
, and maximumFractionDigits
are required for the basics.
@darkbluesun as I'm learning, there are lots of environments where you can use moment that do not provide a fully baked toLocaleString
implementation. I'm going to see what I can do about getting a fallback version into the plugin.
Open the console, run:
moment.duration(928515).format();
Safari Says:"15:29"
IE10 Says:"Unable to get property '1' of undefined or null reference"