modules: fix default values

fix default values for luci-base and luci-mod-{dashboard,status,system}

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
This commit is contained in:
Andy Chiang
2025-10-21 04:18:35 +07:00
committed by Paul Donald
parent 2382578209
commit f83fe35dae
4 changed files with 8 additions and 9 deletions

View File

@@ -73,12 +73,12 @@ var CBILogreadBox = function(logtag, name) {
try {
const tz = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_');
const ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0;
const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
const logEntries = await callLogRead(this.fetchMaxRows, false, true);
const dateObj = new Intl.DateTimeFormat(undefined, {
dateStyle: 'medium',
timeStyle: (ts == 0) ? 'long' : 'full',
hourCycle: hc,
hourCycle: (hc == 0) ? undefined : hc,
timeZone: tz
});

View File

@@ -315,12 +315,12 @@ return baseclass.extend({
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') || 0;
const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
const hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
datestr = new Intl.DateTimeFormat(undefined, {
dateStyle: 'medium',
timeStyle: (ts == 0) ? 'long' : 'full',
hourCycle: hc,
hourCycle: (hc == 0) ? undefined : hc,
timeZone: zn
}).format(date);
}

View File

@@ -52,12 +52,12 @@ return baseclass.extend({
var date = new Date(unixtime * 1000),
zn = uci.get('system', '@system[0]', 'zonename')?.replaceAll(' ', '_') || 'UTC',
ts = uci.get('system', '@system[0]', 'clock_timestyle') || 0,
hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
datestr = new Intl.DateTimeFormat(undefined, {
dateStyle: 'medium',
timeStyle: (ts == 0) ? 'long' : 'full',
hourCycle: hc,
hourCycle: (hc == 0) ? undefined : hc,
timeZone: zn
}).format(date);
}

View File

@@ -52,12 +52,12 @@ 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') || 0,
hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 'h23';
hc = uci.get('system', '@system[0]', 'clock_hourcycle') || 0;
return new Intl.DateTimeFormat(undefined, {
dateStyle: 'medium',
timeStyle: (ts == 0) ? 'long' : 'full',
hourCycle: hc,
hourCycle: (hc == 0) ? undefined : hc,
timeZone: zn
}).format(date);
}
@@ -157,7 +157,6 @@ return view.extend({
};
o = s.taboption('general', form.Flag, 'clock_timestyle', _('Full TimeZone Name'), _('Unchecked means the timezone offset (E.g. GMT+1) is displayed'));
o.default = o.enabled;
o = s.taboption('general', form.ListValue, 'clock_hourcycle', _('Time Format'));
o.value('', _('Default'));