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

When I set date range, if the max date before current date, I met a bug #37

Open laobie opened 8 years ago

laobie commented 8 years ago

When I set date range, if the max date before current date, it will show a date range selection view. I just want to select one day between the date range I set before, but not a range ...

Here is my code which set date range:

 Calendar calendar = Calendar.getInstance();
 calendar.set(Calendar.DAY_OF_MONTH, 8);
 options.setDateRange(Long.MIN_VALUE, calendar.getTimeInMillis());

in SublimeDatePicker.java , method setMaxDate(long maxDate), I found such code

 if (mCurrentDate.getEndDate().after(mTempDate)) {
    mCurrentDate.getEndDate().setTimeInMillis(maxDate);
    onDateChanged(false, true, true);
 }

when I delete this code, it work well.

image

Now result: image this is I expected result: image

ramkadam commented 7 years ago

I'm also facing same issue please give me solution.Thank you in advance.

laobie commented 7 years ago

@ramkadam I fix this bug in my forked repository. laobie/SublimePicker

You can use my repository by this way:

compile 'com.github.laobie:sublimePicker:1.0'