mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-02-17 12:20:51 +01:00
fixing an illegal offset exception caused by daylight savings
This commit is contained in:
parent
ed7e90e17d
commit
2907023b37
@ -1100,17 +1100,22 @@ class EventActivity : SimpleActivity() {
|
||||
}
|
||||
|
||||
private fun timeSet(hours: Int, minutes: Int, isStart: Boolean) {
|
||||
if (isStart) {
|
||||
val diff = mEventEndDateTime.seconds() - mEventStartDateTime.seconds()
|
||||
try {
|
||||
if (isStart) {
|
||||
val diff = mEventEndDateTime.seconds() - mEventStartDateTime.seconds()
|
||||
|
||||
mEventStartDateTime = mEventStartDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
|
||||
updateStartTimeText()
|
||||
mEventStartDateTime = mEventStartDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
|
||||
updateStartTimeText()
|
||||
|
||||
mEventEndDateTime = mEventStartDateTime.plusSeconds(diff.toInt())
|
||||
updateEndTexts()
|
||||
} else {
|
||||
mEventEndDateTime = mEventEndDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
|
||||
updateEndTimeText()
|
||||
mEventEndDateTime = mEventStartDateTime.plusSeconds(diff.toInt())
|
||||
updateEndTexts()
|
||||
} else {
|
||||
mEventEndDateTime = mEventEndDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
|
||||
updateEndTimeText()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
timeSet(hours + 1, minutes, isStart)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user