@Override
public void onDateSet(DatePicker view, int year, int monthOfYear,
int dayOfMonth) {
dateET.setText(dayOfMonth + "/" + monthOfYear + "/" + year);
}
I want to avoid user setting date past to current date.
So, is there a way i can get the long timestamp (may be 12:00 A.M of the date set), so that i can compare it with the current timestamp and if it is less, the date will be set to default(current date + 3 days).
Thank You
You have to do it yourself:
Calendar calendar = new GregorianCalendar(year, monthOfYear, dayOfMonth);
calendar.getTimeInMillis();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With