luci-mod-*: initialize default values
authorPaul Donald <[email protected]>
Mon, 20 Oct 2025 19:10:54 +0000 (21:10 +0200)
committerPaul Donald <[email protected]>
Mon, 20 Oct 2025 19:10:54 +0000 (21:10 +0200)
follow-up to
e67465da5e4bb2afdd0216f4875c627f287a7f3d
b0004ad39cbe46ee449dd5576f0433847e777bb7
71ea35fc7f41e8b1c6c02e0bcc8d8bfcba3bde7f

Signed-off-by: Paul Donald <[email protected]>
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js
modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js
modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js

index 8005ff67448f101e105e88b326a5735d50c1c245..2990929cc9920799c01ea0b5ba1497ed846a93e0 100644 (file)
@@ -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',
index 4c7876d5b9217c529117f7d9ba89dd9500e39630..043051e4626daa9a95d72058be386ecc79a54129 100644 (file)
@@ -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',
index 40110f62f020423cc1be0176788e68dc0093387e..80ad921e9a7b9c5a4ccacf92cf41b4e8eddb7366 100644 (file)
@@ -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',