From: Paul Donald Date: Mon, 20 Oct 2025 19:10:54 +0000 (+0200) Subject: luci-mod-*: initialize default values X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=523b3ea372d2d3790655374ee83fa4d1dd82c264;p=project%2Fluci.git luci-mod-*: initialize default values follow-up to e67465da5e4bb2afdd0216f4875c627f287a7f3d b0004ad39cbe46ee449dd5576f0433847e777bb7 71ea35fc7f41e8b1c6c02e0bcc8d8bfcba3bde7f Signed-off-by: Paul Donald --- diff --git a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js index 8005ff6744..2990929cc9 100644 --- a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js +++ b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js @@ -314,8 +314,8 @@ return baseclass.extend({ if (unixtime) { const date = new Date(unixtime * 1000); const zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC'; - const ts = uci.get('system', '@system[0]', 'clock_timestyle'); - const hc = uci.get('system', '@system[0]', 'clock_hourcycle'); + const ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0; + const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23'; datestr = new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', 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 4c7876d5b9..043051e462 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 @@ -51,8 +51,8 @@ return baseclass.extend({ if (unixtime) { var date = new Date(unixtime * 1000), zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC', - ts = uci.get('system', '@system[0]', 'clock_timestyle'), - hc = uci.get('system', '@system[0]', 'clock_hourcycle'); + ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0, + hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23'; datestr = new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js index 40110f62f0..80ad921e9a 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js @@ -51,8 +51,8 @@ callTimezone = rpc.declare({ function formatTime(epoch) { var date = new Date(epoch * 1000), zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC', - ts = uci.get('system', '@system[0]', 'clock_timestyle'), - hc = uci.get('system', '@system[0]', 'clock_hourcycle'); + ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0, + hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23'; return new Intl.DateTimeFormat(undefined, { dateStyle: 'medium',