调整编辑功能
This commit is contained in:
@@ -853,16 +853,24 @@ new Vue({
|
|||||||
},
|
},
|
||||||
formatDateTime(datetime) {
|
formatDateTime(datetime) {
|
||||||
if (!datetime) return '';
|
if (!datetime) return '';
|
||||||
// 解析 GMT 时间字符串
|
try {
|
||||||
const date = new Date(datetime);
|
// 确保输入是有效的日期字符串
|
||||||
const year = date.getUTCFullYear();
|
const date = new Date(datetime);
|
||||||
const month = String(date.getUTCMonth() + 1).padStart(2, '0');
|
if (isNaN(date.getTime())) {
|
||||||
const day = String(date.getUTCDate()).padStart(2, '0');
|
return datetime; // 如果解析失败,返回原始字符串
|
||||||
const hours = String(date.getUTCHours()).padStart(2, '0');
|
}
|
||||||
const minutes = String(date.getUTCMinutes()).padStart(2, '0');
|
const year = date.getUTCFullYear();
|
||||||
const seconds = String(date.getUTCSeconds()).padStart(2, '0');
|
const month = String(date.getUTCMonth() + 1).padStart(2, '0');
|
||||||
|
const day = String(date.getUTCDate()).padStart(2, '0');
|
||||||
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
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}`;
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Date parsing error:', e);
|
||||||
|
return datetime; // 如果出错,返回原始字符串
|
||||||
|
}
|
||||||
},
|
},
|
||||||
refreshTasks() {
|
refreshTasks() {
|
||||||
this.loadTasks();
|
this.loadTasks();
|
||||||
|
|||||||
Reference in New Issue
Block a user