Calendar: fix first-day-of-week (#21057)

pull/21065/head
好多大米 2021-06-09 17:45:35 +08:00 committed by GitHub
parent 9a4b758b77
commit 8168d14e67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -124,7 +124,8 @@ export default {
let firstDay = getFirstDayOfMonth(date);
firstDay = firstDay === 0 ? 7 : firstDay;
const firstDayOfWeek = typeof this.firstDayOfWeek === 'number' ? this.firstDayOfWeek : 1;
const prevMonthDays = getPrevMonthLastDays(date, firstDay - firstDayOfWeek).map(day => ({
const offset = (7 + firstDay - firstDayOfWeek) % 7;
const prevMonthDays = getPrevMonthLastDays(date, offset).map(day => ({
text: day,
type: 'prev'
}));