You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/sched/ChangeLog
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,3 +41,4 @@
41
41
0.38: Fix timer going off immediately if it was long enough it went to the next day (#4220)
42
42
0.39: Allow a press of the button to stop/snooze the alarm when it's gone off
43
43
0.40: Prevent time-of-day alarms set via setAlarm() that have a time earlier than the current time triggering immediately after #4220 fix; schedule them for tomorrow by default to match original behavior
44
+
0.41: Fix issue with snoozing alarms and timers beyond midnight causing the alarm/timer to go off immediately instead of snoozing
Copy file name to clipboardExpand all lines: apps/sched/lib.js
+19-5Lines changed: 19 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -34,13 +34,27 @@ exports.getActiveAlarms = function (alarms, time) {
34
34
// Set up a modified alarm/timer so it's ready to insert into the list of alarms. For timers, they fire the set time from now, and alarms are set to fire at the right time on the right day
35
35
exports.updateAlarm=function(alarm){
36
36
vartime=newDate(),currentTime=timeToMillis(time);
37
-
if(alarm.timer){// if it's a timer, set the start time as a time from *now*
38
-
alarm.t=(currentTime+alarm.timer)%86400000;// alarm time in day
37
+
if(alarm.timer){
38
+
if(alarm.ot!==undefined){
39
+
// if `ot` exists, the timer is currently snoozed. In that case,
40
+
// `t` is expected to be the time of day the snoozed alarm
41
+
// should trigger again. If `t` < current time of day, set
42
+
// `date` to tomorrow to avoid an immediate false trigger.
0 commit comments