-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Description
Element UI version
2.15.14
OS/Browsers version
win11
Vue version
2.6.7
Reproduction Link
https://codepen.io/luo19/pen/MYyxvVm
Steps to reproduce
本地时间为20251212,el-datepicker 设置type="week", :picker-options="{firstDayOfWeek: 2}",当el-date-picker__header上日期为2025-12月时,选择50周,pannel关闭后再打开选择的是下一周。当el-date-picker__header上日期为2025-11月时都是OK的,firstDayOfWeek=4时没有这个问题,不配置firstDayOfWeek也是正常的,具体可以看操作步骤视频。
把type=week 改成type=date也有这个问题。
The local time is 20251212. When using el-datepicker with type="week" and :picker-options="{firstDayOfWeek: 2}", selecting week 50 when the date displayed in el-date-picker__header is December 2025 results in the next week being selected upon reopening the panel. However, when the date in el-date-picker__header is November 2025, everything functions correctly. The issue does not occur when firstDayOfWeek=4, nor when firstDayOfWeek is not configured. For detailed steps, refer to the instructional video.
Changing type=week to type=date also presents this issue.
https://www.bilibili.com/video/BV1GimEBtEaS/
What is Expected?
当el-date-picker__header上日期为2025-12月时与el-date-picker__header上日期为2025-11月时操作后选择的week一致
When the date on the el-date-picker__header is December 2025, the selected week remains consistent with the selection when the date is November 2025
What is actually happening?
当el-date-picker__header上日期为2025-12月时与el-date-picker__header上日期为2025-11月时操作后选择的week不一致,例如el-date-picker__header上日期为2025-12的选中50周,会变成51周,计算有问题。
When the date on el-date-picker_header is between December 2025 and November 2025, the week selected after the operation is inconsistent. For example, if 50 weeks are selected for the date on el-date-picker_header between December 2025 and November 2025, it will become 51 weeks, which is a calculation problem.