The current date in the Material Date Range picker is showing as yesterday's date. I looked into source code for the Material Design Picker and it seems to change the date while getting the date for the UTC timezone. The current date is the one which is encircled in the calendar. Is there any way to resolve the issue? The date range picker should show the correct date despite of the timezones.
One solution for the problem would be to change the current date manually, and I tried looking in the source code for the Datepicker but dont seem to find a method for this. Can the current date of Material Date Range picker be changed?
I am initialising the date picker as:
MaterialDatePicker.Builder builder = MaterialDatePicker.Builder.dateRangePicker();
final MaterialDatePicker materialDatePicker = builder.build();
materialDatePicker.show(fragmentManager, materialDatePicker.toString());
Kindly help.
It is fixed in the last release:
https://github.com/material-components/material-components-android/releases/tag/1.2.0-rc01
Fixed issue that caused highlighting the wrong day as today -> commit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With