1.4.3
Ubuntu 16.04 / Chrome Latest
2.4.2
https://jsfiddle.net/pj71jkyw/517/
1.Click on the date picker.
2.Pick any week
It should take Sunday as the first day since it has prop firstDayOfWeek=7
By default it takes monday for any value of firstDayOfWeek
firstDayOfWeek
should be nested in picker-options
: https://jsfiddle.net/pj71jkyw/520/
It doesn't select sunday or any other other day even after the the change. It is monday by default.
@Leopoldthecoder I am experiencing the issue as well, your given JSFiddle actually demonstrates the issue. If the firstDayOfWeek
parameter is set to 7 it should be selecting the date of Sunday instead of Monday. The issue seems to be caused by this line:
Where it is automatically selecting the cell at index 1. Shouldn't this change depending on what the firstDayOfWeek
parameter is? A better option might actually be to select the first cell (index 0) no matter what so that when you do set the firstDayOfWeek
so you know it will be returning that day. Currently in your example when you have the first day of the week set to Wednesday, it is returning the date for Thursday. I believe what @AshwinTayson is wanting is for it to return the day of the week she passes in.
Yes, this is a bug. Will take a look later.
So that's the reason why it always chooses the day after the firstDayOfWeek here?
https://jsfiddle.net/simshaun/mmx38qxw/1927/
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi all, this issue actually still not fixed. I raise a new issue with repro link.
Most helpful comment
@Leopoldthecoder I am experiencing the issue as well, your given JSFiddle actually demonstrates the issue. If the
firstDayOfWeek
parameter is set to 7 it should be selecting the date of Sunday instead of Monday. The issue seems to be caused by this line:https://github.com/ElemeFE/element/blob/762f337b2c8eac32eb1cc85c4af1e7718973cdeb/packages/date-picker/src/basic/date-table.vue#L364-L366
Where it is automatically selecting the cell at index 1. Shouldn't this change depending on what the
firstDayOfWeek
parameter is? A better option might actually be to select the first cell (index 0) no matter what so that when you do set thefirstDayOfWeek
so you know it will be returning that day. Currently in your example when you have the first day of the week set to Wednesday, it is returning the date for Thursday. I believe what @AshwinTayson is wanting is for it to return the day of the week she passes in.