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.

formatShortWeekday always returns a date string in English

See original GitHub issue

Even if my locale is set to ‘fr-FR’, formatShortWeekday pass as 1st argument the date in english and as a String, I can’t manage to format it as I would.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
tokurvincommented, Sep 6, 2019

@tokurvin As documentation states, first argument is locale, second is date.

I actually tried that first, but then changed it to what you recommended above. Unfortunately I am still so inexperienced, I did not understand that was not a solution, but something else…

But I think I now got it working by adding the following inline: formatShortWeekday={(locale,value) => [‘Su’, ‘Ma’, ‘Ti’, ‘Ke’, ‘To’, ‘Pe’, ‘La’][value.getDay()]}

I tried to create a callback and it was probably the issue I had.

0reactions
ngocduong6697commented, Dec 17, 2021

Thanks, @tokurvin At this time, I’m using this library, but I don’t know formatShortWeekday, your comment helps me a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DateFormatter returning string with incorrect language
You want to change the date format with the current device language. Set Locale as your preferred language let formatter = DateFormatter() ...
Read more >
Date.prototype.toLocaleDateString() - JavaScript | MDN
The toLocaleDateString() method returns a string with a language-sensitive representation of the date portion of the specified date in the ...
Read more >
Strange problem - date is always displayed in English
I turned on language debugging. I find the corresponding date string in moodledata/lang/bg/langconfig.php and added additional characters to ...
Read more >
Dates - Julia Documentation - The Julia Programming Language
(Note that the default year is 1 AD/CE.) Consequently, an empty string will always return 0001-01-01 for Date s, and 0001-01-01T00:00:00.000 for DateTime...
Read more >
Date and time localization - Lokalise Blog
As you can see, it returns the date as a string including the time zone. In JavaScript, the ISO date format can be...
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