mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-07 01:35:00 -05:00
select old date doesn't need save
This commit is contained in:
parent
6dbf482755
commit
d4d6de1bc5
@ -88,6 +88,10 @@ 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);
|
||||||
|
long numDays = (date.getTimeInMillis() / 86400000) - (mOriginalExpiryDate.getTimeInMillis() / 86400000);
|
||||||
|
if (numDays == 0)
|
||||||
|
setExpiryDate(mOriginalExpiryDate);
|
||||||
|
else
|
||||||
setExpiryDate(date);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user