element icon indicating copy to clipboard operation
element copied to clipboard

[Bug Report] when DatePicker set type='week' and picker-options={ 'firstDayOfWeek':3},the result of selection will be wrong

Open SusumuFu opened this issue 2 years ago • 4 comments

Element UI version

2.15.8

OS/Browsers version

chrome

Vue version

2.6.14

Reproduction Link

https://elementui.github.io/issue-generator

Steps to reproduce

设置周选择器firstDayOfWeek:3,当月份的1号为周一或周二时,如2022年2月,2022年3月,控件将选中实际选择的下一周

What is Expected?

周选择器,以周三开始周时,选中值与实际选择保持一致

What is actually happening?

周选择器,以周三开始周时,选中值为实际选择的下一周

SusumuFu avatar May 27 '22 08:05 SusumuFu

what's meaning

5z5 avatar May 28 '22 17:05 5z5

Can YOU give me a firstDayOfWeek configuration

5z5 avatar May 28 '22 17:05 5z5

@5z5

<el-date-picker v-model="weekValue" type="week" format="yyyy 第 WW 周" placeholder="选择周" :picker-options="pickerOptions" @change="weekChange"

pickerOptions: { firstDayOfWeek: 3, },

please change month to Feb in any year , and choose week includes 2rd Feb or next week, you will see the value of weekValue and chosen line in page doesn't match

USTCAK avatar Jul 13 '22 10:07 USTCAK

/packages/date-picker/src/basic/date-table.vue文件中,handleClick事件,当firstDayOfWeek改变时,时间选择table的页面是不同的,并且401行,如果是week,column直接等于1,这样得到点击的日期值是错误的,进而根据日期计算出的周的时间也是错误的

Can YOU give me a firstDayOfWeek configuration

helloword1989 avatar Aug 04 '22 06:08 helloword1989