Adding a min date not to go below creation date

This commit is contained in:
Bhargav Golla 2014-03-04 22:37:56 -05:00
parent a1230bbe53
commit 7a95784074

View File

@ -106,7 +106,8 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
mDeleteButton.setOnClickListener(this); mDeleteButton.setOnClickListener(this);
setExpiryDate(null); setExpiryDate(null);
String creationDate = mCreationDate.getText().toString();
Date date = DateFormat.getDateInstance().parse(creationDate);
mExpiryDateButton.setOnClickListener(new OnClickListener() { mExpiryDateButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) { public void onClick(View v) {
GregorianCalendar date = mExpiryDate; GregorianCalendar date = mExpiryDate;
@ -129,6 +130,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
} }
} }
}); });
dialog.getDatePicker().setMinDate(date.getTime());
dialog.show(); dialog.show();
} }
}); });