Fix bug with schedule end being set to midnight.

This commit is contained in:
Cody Henthorne
2021-12-20 13:16:31 -05:00
committed by Greyson Parrelli
parent b69ffe4e15
commit adcb1bae13
4 changed files with 26 additions and 5 deletions

View File

@@ -60,7 +60,8 @@ class EditNotificationProfileScheduleViewModel(
}
fun setEndTime(hour: Int, minute: Int) {
scheduleSubject.onNext(schedule.copy(end = hour * 100 + minute))
val adjustedEndHour = if (hour == 0) 24 else hour
scheduleSubject.onNext(schedule.copy(end = adjustedEndHour * 100 + minute))
}
fun setEnabled(enabled: Boolean) {