Skip to content

Commit f83fe35

Browse files
RickLiuM2A1T90MQ-9systemcrash
authored andcommitted
modules: fix default values
fix default values for luci-base and luci-mod-{dashboard,status,system} Signed-off-by: Andy Chiang <[email protected]>
1 parent 2382578 commit f83fe35

File tree

4 files changed

+8
-9
lines changed
  • modules
    • luci-base/htdocs/luci-static/resources/tools
    • luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include
    • luci-mod-status/htdocs/luci-static/resources/view/status/include
    • luci-mod-system/htdocs/luci-static/resources/view/system

4 files changed

+8
-9
lines changed

modules/luci-base/htdocs/luci-static/resources/tools/views.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ var CBILogreadBox = function(logtag, name) {
7373
try {
7474
const tz = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_');
7575
const ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0;
76-
const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
76+
const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
7777
const logEntries = await callLogRead(this.fetchMaxRows, false, true);
7878
const dateObj = new Intl.DateTimeFormat(undefined, {
7979
dateStyle: 'medium',
8080
timeStyle: (ts == 0) ? 'long' : 'full',
81-
hourCycle: hc,
81+
hourCycle: (hc == 0) ? undefined : hc,
8282
timeZone: tz
8383
});
8484

modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,12 @@ return baseclass.extend({
315315
const date = new Date(unixtime * 1000);
316316
const zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC';
317317
const ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0;
318-
const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
318+
const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
319319

320320
datestr = new Intl.DateTimeFormat(undefined, {
321321
dateStyle: 'medium',
322322
timeStyle: (ts == 0) ? 'long' : 'full',
323-
hourCycle: hc,
323+
hourCycle: (hc == 0) ? undefined : hc,
324324
timeZone: zn
325325
}).format(date);
326326
}

modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ return baseclass.extend({
5252
var date = new Date(unixtime * 1000),
5353
zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC',
5454
ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0,
55-
hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
55+
hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
5656

5757
datestr = new Intl.DateTimeFormat(undefined, {
5858
dateStyle: 'medium',
5959
timeStyle: (ts == 0) ? 'long' : 'full',
60-
hourCycle: hc,
60+
hourCycle: (hc == 0) ? undefined : hc,
6161
timeZone: zn
6262
}).format(date);
6363
}

modules/luci-mod-system/htdocs/luci-static/resources/view/system/system.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ function formatTime(epoch) {
5252
var date = new Date(epoch * 1000),
5353
zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC',
5454
ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0,
55-
hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
55+
hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
5656

5757
return new Intl.DateTimeFormat(undefined, {
5858
dateStyle: 'medium',
5959
timeStyle: (ts == 0) ? 'long' : 'full',
60-
hourCycle: hc,
60+
hourCycle: (hc == 0) ? undefined : hc,
6161
timeZone: zn
6262
}).format(date);
6363
}
@@ -157,7 +157,6 @@ return view.extend({
157157
};
158158

159159
o = s.taboption('general', form.Flag, 'clock_timestyle', _('Full TimeZone Name'), _('Unchecked means the timezone offset (E.g. GMT+1) is displayed'));
160-
o.default = o.enabled;
161160

162161
o = s.taboption('general', form.ListValue, 'clock_hourcycle', _('Time Format'));
163162
o.value('', _('Default'));

0 commit comments

Comments
 (0)