diff --git a/templates/index.html b/templates/index.html index f74614f..c44f78f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -27,9 +27,9 @@ {{job.state}} {{job.target_revision}} {{job.yunohost_version}} - {{job.created_time}} - {{job.started_time}} - {{job.end_time}} + {{timestampToDate(job.created_time)}} + {{timestampToDate(job.started_time)}} + {{timestampToDate(job.end_time)}} @@ -41,6 +41,11 @@ data: { jobs: [] }, + methods: { + timestampToDate: function (timestamp) { + return new Date(timestamp * 1000).toLocaleString() + } + } }) ws = new WebSocket('ws://' + document.domain + ':' + location.port + '/index-ws'); diff --git a/templates/job.html b/templates/job.html index d9324fc..42f087e 100644 --- a/templates/job.html +++ b/templates/job.html @@ -17,9 +17,9 @@ State{{job.state}} Target revision{{job.target_revision}} YunoHost version{{job.yunohost_version}} - Created time{{job.created_time}} - Started time{{job.started_time}} - End time{{job.end_time}} + Created time{{timestampToDate(job.created_time)}} + Started time{{timestampToDate(job.started_time)}} + End time{{timestampToDate(job.end_time)}}

Excution log:

@@ -32,6 +32,11 @@ data: { job: {} }, + methods: { + timestampToDate: function (timestamp) { + return new Date(timestamp * 1000).toLocaleString() + } + } }) ws = new WebSocket('ws://' + document.domain + ':' + location.port + '/job-%s-ws');