question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

toFormat() does not work with i18n and fails on Node.js

See original GitHub issue

Trying 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.

screenshot_2018-10-12 15 51 47_yl7br8

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
trentjones21commented, Nov 13, 2018

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.

1reaction
leidercommented, Jun 27, 2019

@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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found