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.

After updating `weekStart` to 1, formatting works fine, but `dayjs.weekdays()` still starts on Sunday

See original GitHub issue

Describe the bug After updating weekStart to 1, formatting works fine, but dayjs.weekdays() still starts on Sunday. I I get: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] Expected behavior I want to get: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]

Information

  • Day.js Version: ^1.11.5
  • OS: Windows 11
  • Browser: Google Chrome 107.0.5304.62
  • Time zone: GMT+02:00 (Warsaw/Poland)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BePo65commented, Oct 29, 2022

Dayjs tries to be as compatible to moment as possible. If you look at the api of moment, you will fond that there is a separate signature for getting the day names in local order (look for moment.weekdays(true)).

So it may be advisable to ask for a new feature that will add this functionality to dayjs (without killing the current functionality).

I suppose, @ortonomy (from issue #1886) will like this too.

And I am sure that @iamkun will appreciate a pr for this 😄

0reactions
BePo65commented, Oct 29, 2022

I would simply change the title to something that makes clear, what this feature should do (e.g. “feature - add option to weekdays() to get weekday names sorted by locale”).

And then we need who creates this feature (via a pull request). Wouldn’t this be something you would do for this project? If you need more information, feel free to ask.

Read more comments on GitHub >

github_iconTop Results From Across the Web

weekdays are incorrect for all instances of en locale ... - GitHub
After updating weekStart to 1, formatting works fine, but dayjs.weekdays() still starts on Sunday #2100. Open.
Read more >
Customize
Day.js is very easy to customize. ... Update an existing locale. ... If the value is 1, Monday will be the start of...
Read more >
[Updated] How to Set 'Week of Year' to Start on Sunday in ...
In this post, I will take you through my solution for creating a 'Week of Year' field that begins on Sunday in Google...
Read more >
Week Start - Sunday instead of Monday - Qlik Community
Solved: Is there any option in QlikView to set the week start globally to desired Day instead of default Monday. I have tried...
Read more >
Get current week start and end date in Java - Stack Overflow
Updated answer using Java 8. Using Java 8 and keeping the same principle as before (the first day of the week depends on...
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