Преглед изворни кода

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'