Coerce hours in range 0 to 23

This commit is contained in:
Naveen 2022-09-27 23:40:39 +05:30
parent 2ff0880cb5
commit 703bb003c1
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ class ScheduleSendDialog(private val activity: BaseSimpleActivity, private var d
}
}
private fun getNextHour() = calendar.get(Calendar.HOUR_OF_DAY) + 1
private fun getNextHour() = (calendar.get(Calendar.HOUR_OF_DAY) + 1).coerceIn(0, 23)
private fun getNextMinute() = (calendar.get(Calendar.MINUTE) + 5).round(5).coerceIn(0, 59)
}