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

fix: modify the miscalculation of the date starting on Sunday in the calendar

wangyuan пре 2 година
родитељ
комит
ba9e86bfb2
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      pages/appointment/appointment.js

+ 4 - 4
pages/appointment/appointment.js

@@ -117,11 +117,11 @@ Page({
     if (that.data.currentWeek < 1) {
       let _bankupWeekList = []
       for (let index = 0; index < 7; index++) {
-        const bDate = new Date(that.data.currentTime - (index + 1) * 86400000).getDate()
-        const _month = Number(baseDate.getMonth() + 1) < 10 ? '0' + Number(baseDate.getMonth() + 1) : baseDate.getMonth() + 1
-        const _day = Number(baseDate.getDate()) < 10 ? '0' + baseDate.getDate() : baseDate.getDate()
+        const bDate = new Date(that.data.currentTime - (index + 1) * 86400000)
+        const _month = Number(bDate.getMonth() + 1) < 10 ? '0' + Number(bDate.getMonth() + 1) : bDate.getMonth() + 1
+        const _day = Number(bDate.getDate()) < 10 ? '0' + bDate.getDate() : bDate.getDate()
         _bankupWeekList.unshift({
-          date: index == 0 ? '约满' : bDate.getDate(),
+          date: bDate.getDate(),
           dateStr: bDate.getFullYear() + '-' + _month + '-' + _day,
           disabled: true,
           status: ''