I\'m using the datePicker and I can disable last days of today and later days after 30 days by the following code:
DatePickerDialog datePicker = new DatePick
Try Android Material Date and Timepicker
Source Link
Disabled Sundays and Saturdays.
You can also disable any specific date using setDisabledDays() method
//Disable all SUNDAYS and SATURDAYS between Min and Max Dates
for (Calendar loopdate = min_date_c; min_date_c.before(max_date_c); min_date_c.add(Calendar.DATE, 1), loopdate = min_date_c) {
int dayOfWeek = loopdate.get(Calendar.DAY_OF_WEEK);
if (dayOfWeek == Calendar.SUNDAY || dayOfWeek == Calendar.SATURDAY) {
Calendar[] disabledDays = new Calendar[1];
disabledDays[0] = loopdate;
datePickerDialog.setDisabledDays(disabledDays);
}
}