ecmascript-intl

Is there a way to get the decimal and thousands separator in ECMAscript Internationalization API?

痞子三分冷 提交于 2019-12-07 06:04:47
问题 I'm trying to use the new Javascript internationalization API, and would like to know if there is a way to get the decimal and thousands (grouping) separator for a Intl.NumberFormat instance? There is a resolvedOptions method on the object, but that does not provide the symbols. In case anybody's wondering, then for en-US, these would be a comma , and period . , such as in 1,000.00 . 回答1: I'm afraid ECMA-402 standard does not define the API that let you access separators. There is also

“Intl not available” in Edge 15

二次信任 提交于 2019-12-05 01:48:50
I'm seeing an Intl not available error in the JS console when my script runs the following code in Edge 15: new Date().toLocaleDateString() I'm a bit stumped by this. It is working just fine in Edge 14, and I can't find any reference to the internationalization API suddenly disappearing from Edge 15. I'm not sure if this is the proper way to test it, but running window.hasOwnProperty("Intl") in the console actually returns true . To me this seems to indicate that Intl actually is there. Anyone with more JS skills able to tell what is really going on here? Make sure your JS code doesn't

Is there an i18n (Intl) shim for JavaScript?

别等时光非礼了梦想. 提交于 2019-12-03 12:06:20
问题 I am looking for a shim for the ECMAScript Internationalization API. Does anyone know of such a project? (Even if it's still currently a work-in-progress.) 回答1: Yes, there's a polyfill for ECMA-402 (aka ECMA Internationalization API Specification) available at https://github.com/andyearnshaw/Intl.js. For use in Node.js applications, you can install with NPM: npm install intl It's also available as a Bower component for the front-end: bower install intl There's support for NumberFormat and

Is there an i18n (Intl) shim for JavaScript?

十年热恋 提交于 2019-12-03 01:42:31
I am looking for a shim for the ECMAScript Internationalization API . Does anyone know of such a project? (Even if it's still currently a work-in-progress.) Andy E Yes, there's a polyfill for ECMA-402 (aka ECMA Internationalization API Specification) available at https://github.com/andyearnshaw/Intl.js . For use in Node.js applications, you can install with NPM: npm install intl It's also available as a Bower component for the front-end: bower install intl There's support for NumberFormat and DateTimeFormat , but no support for Collator . Currently, for client-side browser environments, you

Chrome timeZone option to Date.toLocaleString()

拜拜、爱过 提交于 2019-11-29 20:42:33
I have recently discovered that there is a new extension to JavaScript. This adds several features to the Date object in the toLocaleString , toLocaleDateString and toLocaleTimeString functions. Reference here . I am particularly interested in the timeZone option, that supports IANA/Olson time zones , such as America/New_York or Europe/London . This is currently only supported in Google Chrome . Previous advice was that to work in JavaScript with any other time zone than UTC or your own local time zone, one had to use a library . But now, it appears that this is starting to be incorporated