浏览代码

Calendar:fix not correct day of week when the day is Sunday (#15399)

Calendar:fix not correct day of week when the day is Sunday
QingDeng 6 年之前
父节点
当前提交
e0f42be5b0
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      packages/calendar/src/date-table.vue

+ 2 - 1
packages/calendar/src/date-table.vue

@@ -117,7 +117,8 @@ export default {
         days = currentMonthRange.concat(nextMonthRange);
       } else {
         const date = this.date;
-        const firstDay = getFirstDayOfMonth(date);
+        let firstDay = getFirstDayOfMonth(date);
+        firstDay = firstDay === 0 ? 7 : firstDay;
         const prevMonthDays = getPrevMonthLastDays(date, firstDay - 1).map(day => ({
           text: day,
           type: 'prev'