be smarter at reseting time at all-day events

This commit is contained in:
tibbi 2019-05-04 20:18:09 +02:00
parent d4ceab64ca
commit be4a7e0c31

View file

@ -803,12 +803,15 @@ class EventActivity : SimpleActivity() {
}
private fun resetTime() {
mEventStartDateTime = mEventStartDateTime.hourOfDay().setCopy(0).minuteOfDay().setCopy(0)
mEventEndDateTime = mEventEndDateTime.hourOfDay().setCopy(0).minuteOfDay().setCopy(0)
updateStartTimeText()
if (mEventEndDateTime.isBefore(mEventStartDateTime) &&
mEventStartDateTime.dayOfMonth() == mEventEndDateTime.dayOfMonth() &&
mEventStartDateTime.monthOfYear() == mEventEndDateTime.monthOfYear()) {
mEventEndDateTime = mEventEndDateTime.withTime(mEventStartDateTime.hourOfDay, mEventStartDateTime.minuteOfHour, mEventStartDateTime.secondOfMinute, 0)
updateEndTimeText()
checkStartEndValidity()
}
}
private fun toggleAllDay(isChecked: Boolean) {
hideKeyboard()