element [bug report] when firstdayofweek is not 1, for example, 3 and type is week, the week of the first or last row will be selected incorrectly

k0pti3hp  于 2022-12-31  发布在  其他
关注(0)|答案(7)|浏览(266)

Element UI version

2.15.0

OS/Browsers version

MacBook Pro (Retina, 15-inch, Mid 2015) / chrome 88.0.4324.96(正式版本) (x86_64)

Vue version

2.5.17

codepen.io/ziyoung/pen/rRKYpd

Steps to reproduce

  1. 类型为week时
  2. 设置firstDayOfWeek为2(或者别的值)
  3. 在二月份点击选择一个周,如2月9日到2月15日
  4. 再次点开弹窗,发现选中的周向下偏移了一行

What is Expected?

设置firstDayOfWeek为非默认值时,在二月份选择器选中一周后再次打开弹窗,选中的一行与之前保持一致

What is actually happening?

设置firstDayOfWeek为非默认值时,在二月份选择器选中一周后再次打开弹窗,选中的周向下偏移了一行

wtlkbnrh

wtlkbnrh1#

Translation of this issue:

Element UI version

2.15.0

OS/Browsers version

MacBook Pro (retina, 15 inch, mid 2015) / Chrome 88.0.4324.96 (official version) (x86)_ 64)

Vue version

2.5.17

codepen.io/ziyoung/pen/rRKYpd

Steps to reproduce

  1. When the type is week
  2. Set firstdayofweek to 2 (or other value)
  3. Click to select a week
  4. Click the pop-up window again and find that the selected circumference is shifted downward by one line

What is Expected?

When firstdayofweek is set to a non default value, the week selector is selected and the pop-up window is opened again. The selected line is consistent with the previous one

What is actually happening?

When firstdayofweek is set to a non default value, the week selector is selected and the pop-up window is opened again. The selected week is offset one line downward

ufj5ltwl

ufj5ltwl2#

这个我修复了,大概可以用

4si2a6ki

4si2a6ki3#

@329988300 试了还是不行,这个bug还是存在

elcex8rz

elcex8rz4#

@329988300 试了还是不行,这个bug还是存在

我没提到这个项目,只是自己扣下来改的,如果你需要我可以发给你

yyyllmsg

yyyllmsg6#

@329988300 我最近也在改造elementUI的datepicker,可以请教下如何修复的吗,谢谢

u5rb5r59

u5rb5r597#

@329988300 我最近也在改造elementUI的datepicker,可以请教下如何修复的吗,谢谢

先了解下iso时间格式,然后一步一步debug,找到是哪个函数计算日期错误,然后往上一层一层倒

相关问题