diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-12-01 20:54:52 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-12-01 20:54:52 +0000 |
commit | d7ff116d8a793d47eeca319339bdb75c69445d4c (patch) | |
tree | adc714a809ac2dcabbc3fb6a89f266f73686a9df /modules/admin-full | |
parent | 9abe328f9a85db356d0be69887d594edaa748c34 (diff) |
modules/admin-full: use String.format('%t', ...) in lease status template
Diffstat (limited to 'modules/admin-full')
-rw-r--r-- | modules/admin-full/luasrc/view/admin_network/lease_status.htm | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/modules/admin-full/luasrc/view/admin_network/lease_status.htm b/modules/admin-full/luasrc/view/admin_network/lease_status.htm index 3635577f6..e5827106b 100644 --- a/modules/admin-full/luasrc/view/admin_network/lease_status.htm +++ b/modules/admin-full/luasrc/view/admin_network/lease_status.htm @@ -21,29 +21,7 @@ } else { - var d = 0; - var h = 0; - var m = 0; - var s = st[i].expires; - - if (s > 60) { - m = Math.floor(s / 60); - s = (s % 60); - } - - if (m > 60) { - h = Math.floor(m / 60); - m = (m % 60); - } - - if (h > 24) { - d = Math.floor(h / 24); - h = (h % 24); - } - - timestr = (d > 0) - ? String.format('%dd %dh %dm %ds', d, h, m, s) - : String.format('%dh %dm %ds', h, m, s); + timestr = String.format('%t', st[i].expires); } var tr = tb.insertRow(-1); |