Disable Past Dates in Picker

How do I turn off past dates in the picker? I want users to only select future dates. So I want to disable the current date and all of the past date so that the date can be selected from tomorrow.

Picker datePicker = new Picker();
datePicker.setUIID("small");
datePicker.setType(Display.PICKER_TYPE_DATE);

      

+3


source to share


1 answer


The class Picker

does not allow setting minimum or maximum dates. You can register RFE on this in CN1 Issue Tracker.



However, the class Spinner

allows you to set a minimum and maximum date. Spinner

deprecated as we try to encourage use Picker

when applicable, mainly because it uses the platform native collector widget when available and generally provides better UX. In some cases, for example, you can go back to Spinner and it should still be fine.

+3


source







All Articles