Skip to content

Commit 8168d14

Browse files
authored
Calendar: fix first-day-of-week (#21057)
1 parent 9a4b758 commit 8168d14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/calendar/src/date-table.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ export default {
124124
let firstDay = getFirstDayOfMonth(date);
125125
firstDay = firstDay === 0 ? 7 : firstDay;
126126
const firstDayOfWeek = typeof this.firstDayOfWeek === 'number' ? this.firstDayOfWeek : 1;
127-
const prevMonthDays = getPrevMonthLastDays(date, firstDay - firstDayOfWeek).map(day => ({
127+
const offset = (7 + firstDay - firstDayOfWeek) % 7;
128+
const prevMonthDays = getPrevMonthLastDays(date, offset).map(day => ({
128129
text: day,
129130
type: 'prev'
130131
}));

0 commit comments

Comments
 (0)