select old date doesn't need save

This commit is contained in:
Ashley Hughes 2014-02-06 20:07:04 +00:00
parent 6dbf482755
commit d4d6de1bc5

View File

@ -88,7 +88,11 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
if (mDatePickerResultCount++ == 0) { if (mDatePickerResultCount++ == 0) {
GregorianCalendar date = new GregorianCalendar(TimeZone.getTimeZone("UTC")); GregorianCalendar date = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
date.set(year, monthOfYear, dayOfMonth); date.set(year, monthOfYear, dayOfMonth);
setExpiryDate(date); long numDays = (date.getTimeInMillis() / 86400000) - (mOriginalExpiryDate.getTimeInMillis() / 86400000);
if (numDays == 0)
setExpiryDate(mOriginalExpiryDate);
else
setExpiryDate(date);
if (mEditorListener != null) { if (mEditorListener != null) {
mEditorListener.onEdited(); mEditorListener.onEdited();
} }
@ -231,7 +235,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
} else { } else {
cal.setTime(PgpKeyHelper.getExpiryDate(key)); cal.setTime(PgpKeyHelper.getExpiryDate(key));
setExpiryDate(cal); setExpiryDate(cal);
mOriginalExpiryDate = cal; // TODO: ensure time doesn't matter when selecting the same date as before mOriginalExpiryDate = cal;
} }
} }