How to disable certain days in custom date picker

95 Views Asked by At

How to disable certain dates in android date picker . for example : I wants to disable next 2 days from today and then range is upto 10 days .Like suppose today is 09-04-2019 then I wants to disable 10th April ,11th April and enable days ranging from 12th April to next 15 Days . Is there any library available?

1

There are 1 best solutions below

0
On

I had a similar requirement and since the android one is too basic you might want to use some library to achieve this. I used this library for this purpose.

You have to use this line:

dp.setSelectableDays(Calendar[] days)

You have to pass array of Calendar as an parameter which contains all the selectable dates.