Limit previous dates in the DatePicker Dialog Android dialog box

I want to customize the DatePicker dialog that I use in my Android application so that it can only select current and future dates. Can this be done?

+3
source share
1 answer

I have not tried it, but it looks like setMinDate and setMaxDate might be what you are looking for.

setMinDate (long) Sets the minimum date that this NumberPicker supports in milliseconds since January 1, 1970, 00:00:00 in the getDefault () time zone.

http://developer.android.com/reference/android/widget/DatePicker.html#setMinDate(long )

+1
source

Source: https://habr.com/ru/post/1771704/


All Articles