I'm trying to disable some days using setDisabledDays(Calendar[] days)
method of wdullaer's material datetime picker, an alternative datetime picker for Android.
But I don't know how to pass the dates to the method using Calendar[]
abscanButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
datePickerDialog = DatePickerDialog.newInstance(MainActivity.this, Year, Month, Day);
datePickerDialog.showYearPickerFirst(false);
datePickerDialog.setMinDate(calendar);
Calendar[] days = new Calendar[3];
days[0] = // I don't know how to do this part
datePickerDialog.setDisabledDays(days);
datePickerDialog.show(getFragmentManager(), "DatePickerDialog");
}
}
I successfully setMinDate()
without any errors. I just need to know how to create the dates I will put in the Calendar
array.
Note: I'm trying to add the dates manually.