[sleeplogalarm] Replace getDay with getDate

master
storm64 2022-11-24 13:29:52 +01:00
parent ad7161cc93
commit ec37f35622
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ function getNextAlarm(allAlarms, fo, withId) {
).map(a => { // add time to alarm ).map(a => { // add time to alarm
a.tTo = sched.getTimeToAlarm(a); a.tTo = sched.getTimeToAlarm(a);
return a; return a;
}).filter(a => a.tTo // filter non active alarms }).filter(a => a.tTo // filter non active alarms
// sort to get next alarm first // sort to get next alarm first
).sort((a, b) => a.tTo - b.tTo)[0] || {}; ).sort((a, b) => a.tTo - b.tTo)[0] || {};
} }
@ -133,7 +133,7 @@ exports = {
// save time of alarm and this day to prevent triggering for the same alarm again // save time of alarm and this day to prevent triggering for the same alarm again
settings.lastTime = alarm.t; settings.lastTime = alarm.t;
settings.lastDate = now.getDay(); settings.lastDate = now.getDate();
require("Storage").writeJSON("sleeplogalarm.settings.json", settings); require("Storage").writeJSON("sleeplogalarm.settings.json", settings);
// write changes // write changes