mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
update the end time if start time is after the end, close #115
This commit is contained in:
@@ -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()
|
||||
|
Reference in New Issue
Block a user