update the end time if start time is after the end, close #115
This commit is contained in:
parent
681dc87b67
commit
0f7b950e15
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue