diff --git a/apps/alarm/ChangeLog b/apps/alarm/ChangeLog index 27e28b2f8..c325b06cf 100644 --- a/apps/alarm/ChangeLog +++ b/apps/alarm/ChangeLog @@ -55,4 +55,4 @@ to select an alarm in the main menu. 0.50: Bangle.js 2: Long touch of alarm in main menu toggle it on/off. Touching the icon on the right will do the same. -0.51: Fix long-touch to enable alarm/timer not updating time (fix #3804) \ No newline at end of file +0.51: Fix long-touch to enable alarm/timer not updating time (fix #3804) diff --git a/apps/alarm/app.js b/apps/alarm/app.js index 1e0611611..df09737dc 100644 --- a/apps/alarm/app.js +++ b/apps/alarm/app.js @@ -87,11 +87,10 @@ function showMainMenu(scroll, group, scrollback) { }; const getGroups = settings.showGroup && !group; const groups = getGroups ? {} : undefined; - var showAlarm; const getIcon = (e)=>{return e.on ? (e.timer ? iconTimerOn : iconAlarmOn) : (e.timer ? iconTimerOff : iconAlarmOff);}; alarms.forEach((e, index) => { - showAlarm = !settings.showGroup || (group ? e.group === group : !e.group); + const showAlarm = !settings.showGroup || (group ? e.group === group : !e.group); if(showAlarm) { const label = trimLabel(getLabel(e),40); menu[label] = { diff --git a/apps/sched/ChangeLog b/apps/sched/ChangeLog index efe4d8e15..3f9906778 100644 --- a/apps/sched/ChangeLog +++ b/apps/sched/ChangeLog @@ -31,4 +31,5 @@ 0.28: Added an icon for disabled events 0.29: Improve clkinfo startup time by 10ms 0.30: Fix possible bug in toggling an alarm to on, from clkinfo -0.31: Ensure we reschedule alarms after setTimeZone has been called (fix #3791) \ No newline at end of file +0.31: Ensure we reschedule alarms after setTimeZone has been called (fix #3791) +0.32: clkinfo ensures an alarm won't trigger immediately (copying `alarm`'s behaviour) diff --git a/apps/sched/lib.js b/apps/sched/lib.js index e11448a18..a0085d820 100644 --- a/apps/sched/lib.js +++ b/apps/sched/lib.js @@ -46,6 +46,9 @@ exports.resetTimer = function(alarm, time) { time = time || new Date(); var currentTime = (time.getHours()*3600000)+(time.getMinutes()*60000)+(time.getSeconds()*1000); alarm.t = (currentTime + alarm.timer) % 86400000; + alarm.last = "timer" in alarm || alarm.t >= require("time_utils").getCurrentTimeMillis() + ? 0 + : new Date().getDate(); }; /// Get time until the given alarm (object). Return undefined if alarm not enabled, or if 86400000 or more, alarm could be *more* than a day in the future exports.getTimeToAlarm = function(alarm, time) { diff --git a/apps/sched/metadata.json b/apps/sched/metadata.json index 8a52068c1..07785749a 100644 --- a/apps/sched/metadata.json +++ b/apps/sched/metadata.json @@ -1,7 +1,7 @@ { "id": "sched", "name": "Scheduler", - "version": "0.31", + "version": "0.32", "description": "Scheduling library for alarms and timers", "icon": "app.png", "type": "scheduler",