diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-11-05 22:15:01 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-11-05 22:15:01 +0100 |
commit | b27b5cfb51de91af90a05a6f31dba7511dedf8b7 (patch) | |
tree | 0f472c8bc3911260be2fc561b6b5d29c8b8df82f | |
parent | 66fc653b099e619e0fcb57b78311f0f13e4b3ccd (diff) |
luci-mod-status: 10_system.js: fix local time display
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js index 8ac7e7cda..4a3517529 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js @@ -34,13 +34,28 @@ return L.Class.extend({ return l.replace(/^\s*\w+\s*=\s*['"]([^'"]+)['"].*$/, '$1'); }).join(' '); + var datestr = null; + + if (systeminfo.localtime) { + var date = new Date(systeminfo.localtime * 1000); + + datestr = '%04d-%02d-%02d %02d:%02d:%02d'.format( + date.getUTCFullYear(), + date.getUTCMonth() + 1, + date.getUTCDate(), + date.getUTCHours(), + date.getUTCMinutes(), + date.getUTCSeconds() + ); + } + var fields = [ _('Hostname'), boardinfo.hostname, _('Model'), boardinfo.model, _('Architecture'), boardinfo.system, _('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''), _('Kernel Version'), boardinfo.kernel, - _('Local Time'), systeminfo.localtime ? (new Date(systeminfo.localtime * 1000)).toLocaleString() : null, + _('Local Time'), datestr, _('Uptime'), systeminfo.uptime ? '%t'.format(systeminfo.uptime) : null, _('Load Average'), Array.isArray(systeminfo.load) ? '%.2f, %.2f, %.2f'.format( systeminfo.load[0] / 65535.0, |