Show locale time representation at corpus/job pages.

This commit is contained in:
Patrick Jentsch 2019-09-10 13:40:26 +02:00
parent f87363ac13
commit 48b5b09db1
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@
this.corpus = corpora[this.corpusId]; this.corpus = corpora[this.corpusId];
creationDateElement = document.getElementById("creation-date"); creationDateElement = document.getElementById("creation-date");
creationDateElement.value = this.corpus.creation_date; creationDateElement.value = (new Date(this.corpus.creation_date * 1000)).toLocaleString();
descriptionElement = document.getElementById("description"); descriptionElement = document.getElementById("description");
descriptionElement.innerHTML = this.corpus.description; descriptionElement.innerHTML = this.corpus.description;
titleElement = document.getElementById("title"); titleElement = document.getElementById("title");

View File

@ -17,11 +17,11 @@
this.job = jobs[this.jobId]; this.job = jobs[this.jobId];
creationDateElement = document.getElementById("creation-date"); creationDateElement = document.getElementById("creation-date");
creationDateElement.value = this.job.creation_date; creationDateElement.value = (new Date(this.job.creation_date * 1000)).toLocaleString();
descriptionElement = document.getElementById("description"); descriptionElement = document.getElementById("description");
descriptionElement.innerHTML = this.job.description; descriptionElement.innerHTML = this.job.description;
endDateElement = document.getElementById("end-date"); endDateElement = document.getElementById("end-date");
endDateElement.value = this.job.end_date; endDateElement.value = this.job.end_date ? (new Date(this.job.end_date * 1000)).toLocaleString() : "Not available";
memMbElement = document.getElementById("mem-mb"); memMbElement = document.getElementById("mem-mb");
memMbElement.value = this.job.mem_mb; memMbElement.value = this.job.mem_mb;
nCoresElement = document.getElementById("n-cores"); nCoresElement = document.getElementById("n-cores");
@ -63,7 +63,7 @@
break; break;
case "end_date": case "end_date":
updatedElement = document.getElementById("end-date"); updatedElement = document.getElementById("end-date");
updatedElement.value = operation.value; updatedElement.value = (new Date(operation.value * 1000)).toLocaleString();
M.updateTextFields(); M.updateTextFields();
break; break;
case "status": case "status":