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.

the weekStart option in locale file seens not work.

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

const dayjs = require('dayjs')
const weekday = require('dayjs/plugin/weekday')
const locale = {
  weekStart: 1
}
dayjs.locale(locale, null ,true)
dayjs.extend(weekday)

const d1 = dayjs().startOf('week')

const date = d1.toDate()
console.log(date, d1.weekday())

result is ‘2019-08-17T16:00:00.000Z 0’ Expected behavior A clear and concise description of what you expected to happen. 2019-08-18T16:00:00.000Z 1

Information

  • Day.js Version [e.g. v1.0.0] 1.8.15
  • OS: [e.g. iOS] macOS
  • Browser [e.g. chrome 62] node test.js
  • Time zone: GMT+8 Asia/Shanghai

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ghostcommented, Aug 19, 2019
import from 'dayjs/locale/en-gb' // weekStart 1
 
dayjs.locale('en-gb').startOf('week').format()
0reactions
bilal42011commented, May 20, 2022

This en-gb locale startWeek property is 1 but it is not working …Any solution

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to find first day of the week by locale?
I know I can access the user's locale with UserInfo.getLocale() , but I don't know how to find which day starts the week....
Read more >
When does a week start? - Salesforce Developer Community
For Group and Personal Editions, the week is defined by the Locale setting in the company profile at Setup | Company Profile |...
Read more >
How to set Monday as the first day of the week in GNOME 2 ...
I tried "sudo locale-gen", but it did not generate my necessary locale. So I had to force it with command "sudo locale-gen lv_LV.UTF-8"....
Read more >
Is there any way to set week start from monday in ngx ...
NOTE: I am using Angular 12! The only way I know to make the week start from a different day is to use...
Read more >
Change Schedule Week Start Day - When2Work.com
NOTE: If you have a paid subscription, the start day change will not be immediate, but will occur in that night's update. The...
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