fixing an illegal offset exception caused by daylight savings

This commit is contained in:
tibbi
2019-03-19 20:58:34 +01:00
parent ed7e90e17d
commit 2907023b37

View File

@@ -1100,6 +1100,7 @@ class EventActivity : SimpleActivity() {
}
private fun timeSet(hours: Int, minutes: Int, isStart: Boolean) {
try {
if (isStart) {
val diff = mEventEndDateTime.seconds() - mEventStartDateTime.seconds()
@@ -1112,6 +1113,10 @@ class EventActivity : SimpleActivity() {
mEventEndDateTime = mEventEndDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
updateEndTimeText()
}
} catch (e: Exception) {
timeSet(hours + 1, minutes, isStart)
return
}
}
private fun checkRepeatRule() {