sched: interface.html, sort by type, then time

pull/2782/head
Rob Pilling 2023-05-29 13:32:39 +01:00
parent ed9d4d47c5
commit 138a607a1b
1 changed files with 11 additions and 0 deletions

View File

@ -211,6 +211,17 @@ function getData() {
Util.readStorage('sched.settings.json',data=>{
schedSettings = JSON.parse(data || "{}") || {};
Util.hideModal();
alarms.sort((a, b) => {
let x;
x = !!b.date - !!a.date;
if(x) return x;
x = !!a.timer - !!b.timer;
if(x) return x;
return a.t - b.t;
});
alarms.forEach(alarm => {
renderAlarm(alarm, true);
});