Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
Calendar: fix first-day-of-week (ElemeFE#21057)
Browse files Browse the repository at this point in the history
  • Loading branch information
cs1707 authored and CarterLi committed Nov 19, 2021
1 parent 86840cc commit 7543812
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/calendar/src/date-table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,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'
}));
Expand Down

0 comments on commit 7543812

Please sign in to comment.