Skip to content

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 hzsrc committed Feb 2, 2023
1 parent 7dc9b88 commit ae497df
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 @@ -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'
}));
Expand Down

0 comments on commit ae497df

Please sign in to comment.