Quellcode durchsuchen

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 vor 6 Jahren
Ursprung
Commit
e0f42be5b0
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  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'