update the end time if start time is after the end, close #115
This commit is contained in:
parent
681dc87b67
commit
0f7b950e15
1 changed files with 9 additions and 0 deletions
|
@ -364,6 +364,11 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
|||
if (isStart) {
|
||||
mEventStartDateTime = mEventStartDateTime.withDate(year, month + 1, day)
|
||||
updateStartDate()
|
||||
if (mEventStartDateTime.isAfter(mEventEndDateTime)) {
|
||||
mEventEndDateTime = mEventStartDateTime
|
||||
updateEndDate()
|
||||
updateEndTime()
|
||||
}
|
||||
} else {
|
||||
mEventEndDateTime = mEventEndDateTime.withDate(year, month + 1, day)
|
||||
updateEndDate()
|
||||
|
@ -375,6 +380,10 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
|
|||
if (isStart) {
|
||||
mEventStartDateTime = mEventStartDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
|
||||
updateStartTime()
|
||||
if (mEventStartDateTime.isAfter(mEventEndDateTime)) {
|
||||
mEventEndDateTime = mEventStartDateTime
|
||||
updateEndTime()
|
||||
}
|
||||
} else {
|
||||
mEventEndDateTime = mEventEndDateTime.withHourOfDay(hours).withMinuteOfHour(minutes)
|
||||
updateEndTime()
|
||||
|
|
Loading…
Reference in a new issue