时间处理

This commit is contained in:
Yuan 2022-09-14 18:17:28 +08:00
parent 0026faedfe
commit afabcfbf3b

View File

@ -99,7 +99,11 @@ export default {
return `${this.datetime.getFullYear()}${this.datetime.getMonth() + 1}${this.datetime.getDate()}`
},
time() {
return `${this.datetime.getHours()}:${this.datetime.getMinutes() + 1}`
let h = this.datetime.getHours().toString(),
m = this.datetime.getMinutes().toString()
if (h.length === 1) h = '0' + h
if (m.length === 1) m = '0' + m
return `${h}:${m}`
},
},
data() {