mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-16 06:59:29 +01:00
Allow setting alarms once for the next day.
(cherry picked from commit 417ea02)
This commit is contained in:
parent
7f7cea75c1
commit
6953086c99
@ -121,9 +121,15 @@ public class GBAlarm implements Parcelable, Comparable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Calendar getAlarmCal() {
|
public Calendar getAlarmCal() {
|
||||||
|
|
||||||
Calendar alarm = Calendar.getInstance();
|
Calendar alarm = Calendar.getInstance();
|
||||||
|
Calendar now = Calendar.getInstance();
|
||||||
alarm.set(Calendar.HOUR_OF_DAY, this.hour);
|
alarm.set(Calendar.HOUR_OF_DAY, this.hour);
|
||||||
alarm.set(Calendar.MINUTE, this.minute);
|
alarm.set(Calendar.MINUTE, this.minute);
|
||||||
|
if (now.after(alarm) && repetition == ALARM_ONCE) {
|
||||||
|
//if the alarm is in the past set it to tomorrow
|
||||||
|
alarm.add(Calendar.DATE, 1);
|
||||||
|
}
|
||||||
return alarm;
|
return alarm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user