I am working on a project where I need to restrict the user from choosing any other dates than I want.
by reading some articles and SO post i tried the following which is supposed to work
com.wdullaer.materialdatetimepicker.date.DatePickerDialog dpd = newInstance(
ActivityClaimOffers.this,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH)
);
dpd.setMinDate(calendar);
dpd.setMaxDate(calendar);
but I could not figure out how to pass custom dates as calendar objects. as both setMinDate() and setMaxDate() takes Calendar as parameter
Like this :
Calendar calendar = new GregorianCalendar(year, monthOfYear, dayOfMonth);
and for your code:
dpd.setMinDate(new GregorianCalendar(2000, 5, 23));
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