When I use toLocaleDateString in browser it returns
n = new Date()
n.toLocaleDateString()
\"2/10/2013\"
but in node.js the for
For me, the solution was to install an additional module full-icu for node js
full-icu-npm
And after in package.json insert:
{"scripts":{"start":"node --icu-data-dir=node_modules/full-icu YOURAPP.js"}}
or
In the current version of Node.js v10.9.0 is Internationalization Support.
To control how ICU is used in Node.js, you can configure options are available during compilation.
If the small-icu option is used you need to provide ICU data at runtime:
env NODE_ICU_DATA=/some/directory nodenode --icu-data-dir=/some/directory