Open EdinHas opened 5 years ago
To disable future dates put 0 in nextYear calendar.
final Calendar nextYear = Calendar.getInstance();
nextYear.add(Calendar.YEAR, 0);
To disable past dates, you can set Year, Month, Day to 0.
final Calendar lastYear = Calendar.getInstance();
lastYear.add(Calendar.YEAR, 0);
lastYear.add(Calendar.MONTH, 0);
lastYear.add(Calendar.DAY_OF_MONTH, 0);
ArrayList<Integer> list = new ArrayList<>();
calendar.deactivateDates(list);
ArrayList<Date> arrayList = new ArrayList<>();
calendar.init(
lastYear.getTime(),
nextYear.getTime(),
new Locale(LanguageCodes.ENGLISH))
.inMode(CalendarPickerView.SelectionMode.RANGE)
.withHighlightedDates(arrayList);
I need to disable all dates after today. If its 27th March I need to disable everything from 28th to the next 10 years. Is this possible?
Thanks.