Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material Date Range Picker showing incorrect current date Android

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.

like image 446
Manu Jindal Avatar asked Nov 06 '22 07:11

Manu Jindal


1 Answers

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

like image 89
Giorgio Provenzale Avatar answered Nov 14 '22 21:11

Giorgio Provenzale