toFormat() does not work with i18n and fails on Node.js
See original GitHub issueTrying in Node.js with the following (this is the documentation example):
DateTime.fromISO('2014-08-06T13:07:04.054').setLocale('fr').toFormat('yyyy LLL dd');
I get the result: "null Aug null"
.
The Node app runs on a server in UK (which has not brexited yet 😉 and rather than the French “aou.” for month I get the English “Aug”. Moreover day (dd) and year (yyyy) miserably fail 😭
Luckily, the toLocalString works. But I need to handle various user format.
See screen shot.

Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:23 (6 by maintainers)
Top Results From Across the Web
nodejs i18n __ is not a function issue with ejs, express
It works fine, I can see both hello and helloWithHTML values. But ejs do not recognize i18n variable at all. How can I...
Read more >i18n-js - npm
The translations object is a direct export of translations defined by Ruby on Rails. To export the translations, you can use i18n-js, ...
Read more >JavaScript ES6 Intl not working properly when running Jest tests
Jest tests don't run on top of the browser; they run under Node.js, which doesn't ship the full internationalization support by default. You...
Read more >The Ultimate Guide to JavaScript Localization | Phrase
Being the language of the browser—and putting in work on the server with Node—JavaScript is all over today's web stacks.
Read more >Intl - JavaScript - MDN Web Docs - Mozilla
Chrome Edge
Intl Full support. Chrome24. Toggle history Full support. Edge12. Toggle history
@@toStringTag Full support. Chrome86. Toggle history Full support. Edge86. Toggle history
Collator Full...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was experiencing the same error when running my code using Firebase cloud functions. Upgrading my firebase functions from Node 6 to Node 8 fixed it for me.
@matthiasg thanks a lot for claryfying. The polyfill is indeed not needed. - My personal issue is closed thereby.
One more thing: I guess my observation still hits people in environments where the polyfill IS NEEDED. What’s you opinion?
Greetings from Karlsruhe