Positive button / Today buttonSee original GitHub issue
Am I missing something? Setting the current date as the selected one in code, the date picker opens with the OK button disabled. So the user has to select another date and return to the current one, in order to accept it.
Here is my (Kotlin) code:
val builder = DatePickerBuilder(this, listener) .maximumDate(Calendar.getInstance()) .date(Calendar.getInstance()) .pickerType(CalendarView.ONE_DAY_PICKER) .headerColor(R.color.colorPrimary) .selectionColor(R.color.colorPrimary) val datePicker = builder.build() datePicker.show()
Also, the today button seems to be broken. It does not move the selection to the current date. Shouldn’t it?
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@kormateusz Well, I tried that and it did not work. And by looking at the code, I don’t think it should make a difference. This seems weird.
setOkButtonState(mCalendarProperties.getCalendarType() == CalendarView.ONE_DAY_PICKER);
So, if the Calendar is ONE_DAY_PICKER (as in my case), OK should be enabled. But it is not…