update the end time if start time is after the end, close #115

This commit is contained in:
tibbi 2017-02-19 23:48:11 +01:00
parent 681dc87b67
commit 0f7b950e15
1 changed files with 9 additions and 0 deletions

View File

@ -364,6 +364,11 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
if (isStart) { if (isStart) {
mEventStartDateTime = mEventStartDateTime.withDate(year, month + 1, day) mEventStartDateTime = mEventStartDateTime.withDate(year, month + 1, day)
updateStartDate() updateStartDate()
if (mEventStartDateTime.isAfter(mEventEndDateTime)) {
mEventEndDateTime = mEventStartDateTime
updateEndDate()
updateEndTime()
}
} else { } else {
mEventEndDateTime = mEventEndDateTime.withDate(year, month + 1, day) mEventEndDateTime = mEventEndDateTime.withDate(year, month + 1, day)
updateEndDate() updateEndDate()
@ -375,6 +380,10 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
if (isStart) { if (isStart) {
mEventStartDateTime = mEventStartDateTime.withHourOfDay(hours).withMinuteOfHour(minutes) mEventStartDateTime = mEventStartDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
updateStartTime() updateStartTime()
if (mEventStartDateTime.isAfter(mEventEndDateTime)) {
mEventEndDateTime = mEventStartDateTime
updateEndTime()
}
} else { } else {
mEventEndDateTime = mEventEndDateTime.withHourOfDay(hours).withMinuteOfHour(minutes) mEventEndDateTime = mEventEndDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
updateEndTime() updateEndTime()