diff --git a/static/js/index.es6 b/static/js/index.es6 index d63e90e..af48e60 100644 --- a/static/js/index.es6 +++ b/static/js/index.es6 @@ -51,7 +51,13 @@ window.refreshMirrorList = () => { d['is_new'] = new_mirrors[d['name']]; d['show_status'] = (d.status != "success"); // Strip the second component of last_update - d['last_update'] = d['last_update'].replace(/(\d\d:\d\d):\d\d/, '$1'); + if (d['last_update_ts']) { + let date = new Date(d['last_update_ts'] * 1000); + d['last_update'] = `${('000'+date.getFullYear()).substr(-4)}-${('0'+date.getMonth()).substr(-2)}-${('0'+date.getDay()).substr(-2)}` + + ` ${('0'+date.getHours()).substr(-2)}:${('0'+date.getMinutes()).substr(-2)}`; + } else { + d['last_update'] = d['last_update'].replace(/(\d\d:\d\d):\d\d(\s\+\d\d\d\d)?/, '$1'); + } mirrors.push(d); } var result = Mark.up(mir_tmpl, {mirrors: mirrors});