mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-18 01:16:54 +08:00
A complete maintenance planning system has been created
This commit is contained in:
@@ -22,6 +22,16 @@ export default {
|
||||
return this.datetimeFormat(value, "YYYY-MM-DD HH:mm:ss");
|
||||
},
|
||||
|
||||
datetimeMaintenance(value) {
|
||||
const inputDate = new Date(value);
|
||||
const now = new Date(Date.now());
|
||||
|
||||
if (inputDate.getFullYear() === now.getFullYear() && inputDate.getMonth() === now.getMonth() && inputDate.getDay() === now.getDay())
|
||||
return this.datetimeMaintenanceFormat(value, "HH:mm");
|
||||
else
|
||||
return this.datetimeMaintenanceFormat(value, "YYYY-MM-DD HH:mm");
|
||||
},
|
||||
|
||||
date(value) {
|
||||
return this.datetimeFormat(value, "YYYY-MM-DD");
|
||||
},
|
||||
@@ -41,6 +51,13 @@ export default {
|
||||
return dayjs.utc(value).tz(this.timezone).format(format);
|
||||
}
|
||||
return "";
|
||||
},
|
||||
|
||||
datetimeMaintenanceFormat(value, format) {
|
||||
if (value !== undefined && value !== "") {
|
||||
return dayjs(value).format(format);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user