heysupratim / material-daterange-picker

A material Date Range Picker based on wdullaers MaterialDateTimePicker
Apache License 2.0
1.33k stars 266 forks source link

How do I set default dates different #79

Closed pratikbutani closed 5 years ago

pratikbutani commented 6 years ago

As I show in syntax, you are passing year, month and day. Hopefully it will set default from and to date.

How can I set fromDate different like before six months and toDate as current date.

Thank you.

pratikbutani commented 6 years ago

I found new constructor for specify from and to date individually.

DatePickerDialog dpd = com.borax12.materialdaterangepicker.date.DatePickerDialog.newInstance(
                        AnalyticsFragment.this,
                        now.get(Calendar.YEAR),
                        now.get(Calendar.MONTH),
                        now.get(Calendar.DAY_OF_MONTH),
                        nowEnd.get(Calendar.YEAR),
                        nowEnd.get(Calendar.MONTH),
                        nowEnd.get(Calendar.DAY_OF_MONTH)
                );

Hope you will add in ReadMe