diff options
author | Stephen Bird <sbird@cyngn.com> | 2015-07-16 17:58:38 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-10-18 13:52:56 -0700 |
commit | 03b6e319a3dbf94bc3e3e9ab5a0a888a6cefff19 (patch) | |
tree | 0f86fa17d6ca66473549f5181184a7d2540f905f | |
parent | b7cf653714244ba5fc2c9d71149907f5643d2b88 (diff) | |
download | android_packages_apps_Calendar-03b6e319a3dbf94bc3e3e9ab5a0a888a6cefff19.tar.gz android_packages_apps_Calendar-03b6e319a3dbf94bc3e3e9ab5a0a888a6cefff19.tar.bz2 android_packages_apps_Calendar-03b6e319a3dbf94bc3e3e9ab5a0a888a6cefff19.zip |
prepareForSave: Dont set time in allday events
Change-Id: I0e887b9e4fb6f36b8dd0d452cbcac0c175d93bdc
-rw-r--r-- | src/com/android/calendar/event/EditEventView.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/calendar/event/EditEventView.java b/src/com/android/calendar/event/EditEventView.java index a06774b8..ab61c3d2 100644 --- a/src/com/android/calendar/event/EditEventView.java +++ b/src/com/android/calendar/event/EditEventView.java @@ -570,7 +570,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa if (mModel == null || (mCalendarsCursor == null && mModel.mUri == null)) { return false; } - return fillModelFromUI(); + return fillModelFromUI(true); } public boolean fillModelFromReadOnlyUi() { @@ -667,7 +667,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa } // Goes through the UI elements and updates the model as necessary - private boolean fillModelFromUI() { + private boolean fillModelFromUI(boolean ignoreAllday) { if (mModel == null) { return false; } @@ -716,7 +716,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa } } - if (mModel.mAllDay) { + if (mModel.mAllDay && !ignoreAllday) { // Reset start and end time, increment the monthDay by 1, and set // the timezone to UTC, as required for all-day events. mTimezone = Time.TIMEZONE_UTC; @@ -730,6 +730,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa mEndTime.minute = 0; mEndTime.second = 0; mEndTime.timezone = mTimezone; + mModel.mEnd = mEndTime.normalize(true); // When a user see the event duration as "X - Y" (e.g. Oct. 28 - Oct. 29), end time // should be Y + 1 (Oct.30). final long normalizedEndTimeMillis = @@ -1366,7 +1367,7 @@ public class EditEventView implements View.OnClickListener, DialogInterface.OnCa if (mSaveAfterQueryComplete) { mLoadingCalendarsDialog.cancel(); - if (prepareForSave() && fillModelFromUI()) { + if (prepareForSave() && fillModelFromUI(false)) { int exit = userVisible ? Utils.DONE_EXIT : 0; mDone.setDoneCode(Utils.DONE_SAVE | exit); mDone.run(); |