前端时间格式调整
This commit is contained in:
@@ -852,7 +852,17 @@ new Vue({
|
|||||||
return statusMap[status] || '';
|
return statusMap[status] || '';
|
||||||
},
|
},
|
||||||
formatDateTime(datetime) {
|
formatDateTime(datetime) {
|
||||||
return new Date(datetime).toLocaleString()
|
if (!datetime) return '';
|
||||||
|
// 解析 GMT 时间字符串
|
||||||
|
const date = new Date(datetime);
|
||||||
|
const year = date.getUTCFullYear();
|
||||||
|
const month = String(date.getUTCMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getUTCDate()).padStart(2, '0');
|
||||||
|
const hours = String(date.getUTCHours()).padStart(2, '0');
|
||||||
|
const minutes = String(date.getUTCMinutes()).padStart(2, '0');
|
||||||
|
const seconds = String(date.getUTCSeconds()).padStart(2, '0');
|
||||||
|
|
||||||
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
||||||
},
|
},
|
||||||
refreshTasks() {
|
refreshTasks() {
|
||||||
this.loadTasks();
|
this.loadTasks();
|
||||||
|
|||||||
Reference in New Issue
Block a user