File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -305,8 +305,7 @@ class Utils {
305305 duration = nextAlarm.difference (now);
306306 }
307307 } else if (now.isBefore (todayAlarm) && days[now.weekday - 1 ]) {
308- // If alarm is set for today and time hasn't passed
309- duration = todayAlarm.difference (now);
308+ duration = todayAlarm.difference (now);
310309 } else {
311310 // Finding the next day when alarm will ring
312311 int daysUntilNextAlarm = 7 ;
@@ -315,16 +314,15 @@ class Utils {
315314 for (int i = 1 ; i <= 7 ; i++ ) {
316315 int nextDayIndex = (now.weekday + i - 1 ) % 7 ;
317316 if (days[nextDayIndex]) {
318- if (i < daysUntilNextAlarm) {
319- daysUntilNextAlarm = i;
320- nextAlarm = DateTime (
321- now.year,
322- now.month,
323- now.day + i,
324- alarmTime.hour,
325- alarmTime.minute,
326- );
327- }
317+ daysUntilNextAlarm = i;
318+ nextAlarm = DateTime (
319+ now.year,
320+ now.month,
321+ now.day + i,
322+ alarmTime.hour,
323+ alarmTime.minute,
324+ );
325+ break ;
328326 }
329327 }
330328
You can’t perform that action at this time.
0 commit comments