How to block dates on Date Picker

If you looking to block date on the Android date picker then don’t waste your time it’s not possible. There is no built-in feature by Android date picker to block dates. I am not talking about the past dates or the future dates. That can be easily done using setMinDate() or setMaxDate(). But to block specific dates or maybe a particular day in every week. In this case, you will have to use a custom date picker and wdullaer’s MaterialDateTimePicker provides a simple to do it.

Let’s say you want to block a specific date “25/06/2020”

First, you need to add the dependency in your module level gradle

Now instead of Android Date Picker, you will have to use wdullaer’s MaterialDateTimePicker.

That’s all !!! You can add as many Calender items in the list and block all the specific dates.

Thank you very much. This is Vedesh Kumar signing off.

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close