Explorar o código

留意板时间解析错误

wangcz %!s(int64=6) %!d(string=hai) anos
pai
achega
faa5877974
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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
       }
     },