Redman1037 / EightFoldsDatePickerDialog

DatePickerDialog to set min and max dates
1 stars 1 forks source link

Error when set first and min date as todau #2

Closed benoffi7 closed 7 years ago

benoffi7 commented 7 years ago

When I set the first date and the min date as today

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.coffeeandcookies.construmat/com.coffeeandcookies.construmat.ui.Carro.CalendarioActivity}: java.lang.IllegalArgumentException: fromDate: Tue Sep 26 16:31:22 GMT-03:00 2017 does not precede toDate: Tue Sep 26 16:31:22 GMT-03:00 2017`

EightFoldsDatePickerDialog datePickerDialog=new EightFoldsDatePickerDialog(this, new DatePickerDialog.OnDateSetListener() {
            @Override
            public void onDateSet(DatePicker view, int year, int month, int dayOfMonth) {
                Toast.makeText(CalendarioActivity.this, "Year "+year+" month "+month+" day "+dayOfMonth, Toast.LENGTH_SHORT).show();
            }
        },calendar.get(Calendar.YEAR),calendar.get(Calendar.MONTH),calendar.get(Calendar.DAY_OF_MONTH));   

datePickerDialog.setTodayAsMinDate();   // sets today's date as min date
datePickerDialog.show();
Redman1037 commented 7 years ago

@benoffi7 sorry ,i didn't check this repo for a long time , I am unable to reproduce this issue , how ever i added few tweaks to fix this issue. please confirm if , it is fixed for you.I will reopen if its not fixed yet.