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 {
305
305
duration = nextAlarm.difference (now);
306
306
}
307
307
} 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);
310
309
} else {
311
310
// Finding the next day when alarm will ring
312
311
int daysUntilNextAlarm = 7 ;
@@ -315,16 +314,15 @@ class Utils {
315
314
for (int i = 1 ; i <= 7 ; i++ ) {
316
315
int nextDayIndex = (now.weekday + i - 1 ) % 7 ;
317
316
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 ;
328
326
}
329
327
}
330
328
You can’t perform that action at this time.
0 commit comments