Browse Source

时间格式

lizhuang 4 years ago
parent
commit
aecaa9845d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/views/strategy/index.vue

+ 2 - 2
src/views/strategy/index.vue

@@ -79,8 +79,8 @@ export default {
         },
         formatTime() {
             let year = new Date().getFullYear()
-            let month = new Date().getMonth() + 1 > 10 ? new Date().getMonth() + 1 : '0' + (new Date().getMonth() + 1)
-            let date = new Date().getDate() > 10 ? new Date().getDate() : '0' + new Date().getDate()
+            let month = new Date().getMonth() + 1 >= 10 ? new Date().getMonth() + 1 : '0' + (new Date().getMonth() + 1)
+            let date = new Date().getDate() >= 10 ? new Date().getDate() : '0' + new Date().getDate()
             return (this.today = year + '' + month + '' + date)
         },
         getPer5Time() {