Set end date field as N.a. if the job is not completed.

This commit is contained in:
Patrick Jentsch 2019-11-04 11:04:23 +01:00
parent dfb7f96d2d
commit e1225c95bf

View File

@ -31,6 +31,8 @@
this.job = jobs[this.jobId]; this.job = jobs[this.jobId];
} }
// End date
this.setEndDate(this.job.end_date);
// Status // Status
this.setStatus(this.job.status); this.setStatus(this.job.status);
// End date // End date
@ -73,7 +75,13 @@
} }
setEndDate(timestamp) { setEndDate(timestamp) {
document.getElementById("end-date").value = new Date(timestamp * 1000).toLocaleString(); var end_date;
if (timestamp === null) {
end_date = "N.a.";
} else {
end_date = new Date(timestamp * 1000).toLocaleString();
}
document.getElementById("end-date").value = end_date;
M.updateTextFields(); M.updateTextFields();
} }