Skip to content

Commit

Permalink
Calendar: fix first-day-of-week属性值(7除外)大于当月第一天星期值, 显示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhenchao.Ge authored and Zhenchao.Ge committed Jan 8, 2021
1 parent d216a25 commit 9e7fe19
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 @@ -127,7 +127,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 amount = firstDay - firstDayOfWeek;
const prevMonthDays = getPrevMonthLastDays(date, amount >= 0 ? amount : 7 + amount).map(day => ({
text: day,
type: 'prev'
}));
Expand Down

0 comments on commit 9e7fe19

Please sign in to comment.