From e1225c95bf75019545aca7525dd7a041603176d8 Mon Sep 17 00:00:00 2001
From: Patrick Jentsch
Date: Mon, 4 Nov 2019 11:04:23 +0100
Subject: [PATCH] Set end date field as N.a. if the job is not completed.
---
app/templates/jobs/job.html.j2 | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/app/templates/jobs/job.html.j2 b/app/templates/jobs/job.html.j2
index 2c7d064a..512dc734 100644
--- a/app/templates/jobs/job.html.j2
+++ b/app/templates/jobs/job.html.j2
@@ -31,6 +31,8 @@
this.job = jobs[this.jobId];
}
+ // End date
+ this.setEndDate(this.job.end_date);
// Status
this.setStatus(this.job.status);
// End date
@@ -73,7 +75,13 @@
}
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();
}