Skip to content

Commit

Permalink
update the end time if start time is after the end, close #115
Browse files Browse the repository at this point in the history
  • Loading branch information
tibbi committed Feb 19, 2017
1 parent 681dc87 commit 0f7b950
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 0f7b950

Please sign in to comment.