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',
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',
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',