A complete maintenance planning system has been created

This commit is contained in:
Karel Krýda
2022-01-23 15:22:00 +01:00
parent c3c4db52ec
commit 0d3414c6d6
32 changed files with 1121 additions and 51 deletions

View File

@@ -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 "";
}
},