vikramkakkar / SublimePicker

A material-styled android view that provisions picking of a date, time & recurrence option, all from a single user-interface.
Apache License 2.0
2.31k stars 407 forks source link

How to limit a select dates in date range picker? #75

Open cabuhatprince opened 6 years ago

cabuhatprince commented 6 years ago

I want limit a select dates in date range picker.

for example, Allow to choose 90 days (3 months) only in date range picker.

First i choose start date as 1/1/2017(january 1st, 2017), then the end date to choose is only with in 90 days. Other dates are must in disable state.

eyesblue commented 5 years ago

I have the same question.

eyesblue commented 5 years ago

Ok, I found it by read his code, the code bollew show how to set the range from today to feuture 3 days, you have to imaging how to merge to your code.

long startTime=System.currentTimeMillis(); long endTime=startTime+86400000+86400000;

SublimeOptions sublimeOptions = new SublimeOptions();
sublimeOptions.setDateRange(startTime, endTime); //<=========== KEY POINT

SublimePicker spicker = new SublimePicker(MainActivity.this); spicker.initializePicker(sublimeOptions, YOUR_EVENT_LISTENER);