修复云端录像时间显示错误
parent
9c3967d67a
commit
3436e73e72
|
@ -264,14 +264,16 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
formatTime(time) {
|
formatTime(time) {
|
||||||
const h = parseInt(time / 3600)
|
const h = parseInt(time / 3600 / 1000)
|
||||||
const minute = parseInt(time / 60 % 60)
|
const minute = parseInt((time - h * 3600 * 1000) / 60 / 1000)
|
||||||
const second = Math.ceil(time % 60)
|
let second = Math.ceil((time - h * 3600 * 1000 - minute * 60 * 1000) / 1000)
|
||||||
|
if (second < 0) {
|
||||||
return (h > 0 ? h + `小时` : '') + (minute > 0 ? minute + '分' : '') + second + '秒'
|
second = 0;
|
||||||
|
}
|
||||||
|
return (h > 0 ? h + `小时` : '') + (minute > 0 ? minute + '分' : '') + (second > 0 ? second + '秒' : '')
|
||||||
},
|
},
|
||||||
formatTimeStamp(time) {
|
formatTimeStamp(time) {
|
||||||
return moment.unix(time).format('yyyy-MM-DD HH:mm:ss')
|
return moment.unix(time/1000).format('yyyy-MM-DD HH:mm:ss')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue