Procházet zdrojové kódy

留意板时间解析错误

wangcz před 7 roky
rodič
revize
faa5877974
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      components/default/MessageBoard.vue

+ 2 - 2
components/default/MessageBoard.vue

@@ -170,8 +170,8 @@
       date: function (num) {
         const d = new Date(num)
         const year = d.getFullYear()
-        const month = d.getMonth() + 1 < 10 ? '0' + d.getMonth() : '' + d.getMonth()
-        const day = d.getDay() < 10 ? '0' + d.getDay() : '' + d.getDay()
+        const month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : '' + d.getMonth() + 1
+        const day = d.getDate() < 10 ? '0' + d.getDate() : '' + d.getDate()
         return year + '-' + month + '-' + day
       }
     },