How to disable all yesterday's date from date picker

CodeRED Innovations :

I want to know how can I disable all the yesterday dates when a user requests a date picker. For example when date picker is opened it should allow users to select a date that starts from today and ends after two days.

Like if current date is 22-03-2020 all its previous dates should be disabled and all its future dates should also be disabled from 24-03-2020 and this loop should repeat everytime.

This is worrying me as my app is about to release in a week.

Reham Alatris :
long now = System.currentTimeMillis() - 1000;
dp_time.setMinDate(now);
dp_time.setMaxDate(now+(1000*60*60*24*7)); //After 7 Days from Now for example

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=345755&siteId=1