-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
[Component] [calendar] Calendar 日历 每周第一天始终是周日,修改语言环境无效 #10200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
这个应该是计算机基础知识的问题了,程序上每周的第一天是默认周日的,如果你有需要设置为星期一可以加一天。至于为什么时候周日你可以查阅相关资料。 |
@chenxch 这不是代码BUG吗?我设置语言环境为中文应该默认每周第一天是周一,无需你说的【如果你有需要设置为星期一可以加一天】,日期选择组件显示是正常的,每周第一天是周一 |
每周的第一天是周日,即使是设置中文环境。如果需要请自行修改 Demo |
@tolking 我的项目是多语言切换的,英文每周第一天是周日,中文是周一,请先确认这行代码是否有问题firstDayOfWeek,是否应该在const now = dayjs().locale(lang.value)这行代码下面 |
问题能解决,但Bug依旧存在,设置dayjs.en.weekStart只是妥协方法
|
一样的,你也是要去修改weekStart的 |
DatePicker 日期选择器 这个组件是无需修改weekStart的,它跟随locale,文档写的也是通过国际化来配置,我理解是无需设置weekStart |
导入这个即可
|
Hi, Could you summarize this thread in English please! I would like to set first day of week. Thank you very much! |
Option One: main.js/ts
Option Two: demo |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. 此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。 |
Bug Type:
Component
Environment
3.2.41
2.2.19
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36
Vite
Reproduction
Related Component
el-calendar
Reproduction Link
Github Repo
Steps to reproduce
设置firstDayOfWeek值的代码,是否应该在dayjs().locale(lang.value)这行代码后面?
What is Expected?
每周第一天是周一
What is actually happening?
每周第一天是周日
Additional comments
设置firstDayOfWeek值是否应该在dayjs().locale(lang.value)这行代码后面
The text was updated successfully, but these errors were encountered: