diff --git a/apps/sched/ChangeLog b/apps/sched/ChangeLog index 717763e19..914bd7002 100644 --- a/apps/sched/ChangeLog +++ b/apps/sched/ChangeLog @@ -6,4 +6,4 @@ 0.06: Refactor some methods to library 0.07: Update settings Correct `decodeTime(t)` to return a more likely expected time - +0.08: add day of week check to getActiveAlarms() diff --git a/apps/sched/lib.js b/apps/sched/lib.js index 891776263..ff35c94cb 100644 --- a/apps/sched/lib.js +++ b/apps/sched/lib.js @@ -15,7 +15,12 @@ exports.getActiveAlarms = function(alarms, time) { if (!time) time = new Date(); var currentTime = (time.getHours()*3600000)+(time.getMinutes()*60000)+(time.getSeconds()*1000) +10000;// get current time - 10s in future to ensure we alarm if we've started the app a tad early - return alarms.filter(a=>a.on&&(a.ta.t-b.t); + return alarms.filter(a=>a.on + &&(a.t> (time).getDay() & 1) + .sort((a,b)=>a.t-b.t); } // Set an alarm object based on ID. Leave 'alarm' undefined to remove it exports.setAlarm = function(id, alarm) { diff --git a/apps/sched/metadata.json b/apps/sched/metadata.json index c41e5b5b3..089fffe31 100644 --- a/apps/sched/metadata.json +++ b/apps/sched/metadata.json @@ -1,7 +1,7 @@ { "id": "sched", "name": "Scheduler", - "version": "0.07", + "version": "0.08", "description": "Scheduling library for alarms and timers", "icon": "app.png", "type": "scheduler",