Datepicker to highlight wrong the day as today
I see that https://github.com/material-components/material-components-android/issues/882 is related to datepicker.
Can you try version 1.3.0-alpha01?
They just released it with a few fixes under the "MaterialDatePicker" category. Looks like this issue is in that list.
https://github.com/material-components/material-components-android/releases/tag/1.3.0-alpha01
@ColtonIdle It's the same commit cherry-pick to beta release, so nothing has changed.
@ColtonIdle I see that they marked it as fixed, but really nothing changed.
The issue still exists for users in UTC + timezones like British standard time (UTC+1)
I'm experiencing the same issue with 1.3.0-alpha01, I'm in Germany UTC+2.
Even I am facing this problem, I am in India Timezone (GMT+5:30), and the current date is showing to be yesterdays date.
@ymarian @wcshi, any idea when the change will be rolled out? Kindly try to look into this with priority as it is a production app where we are facing this issue.
Using version 1.3.0-alpha01
Hi @Manu-Jindal this commit (https://github.com/material-components/material-components-android/commit/712a2ce92040b6fc90530ad853633ecd7f258dfc) was made after the 1.3.0-alpha01 cut. It is in our daily release, could you please try it to verify whether it fixes the problem you are facing?
Here are some instructions for how to use the daily build:
https://github.com/material-components/material-components-android/issues/824#issuecomment-567044986
Hi @wcshi, it worked! Thanks a lot! :D
Do we have any idea when this will make it into a release? It seems like the project is on roughly a monthly release cycle so can we expect this in July's release?
Hi @wcshi
i used the material:1.3.0-alpha02 and it seems it solves one issue of highlighting the initial current day. on the other hand, it seems it still has an issue when i use setSelection(long ms). it is not accounting for the time zone offset and is selecting the day prior.
Update: It seems that the value returened from MaterialPickerOnPositiveButtonClickListener is in UTC timezone.
is it all functions/logic behind MaterialDatePicker is based on UTC. can we initiate it with the local timezone
@Abu-Abdullah It's simpler for us to maintain everything in UTC and let the client do conversions. Please let us now if any method is not document correctly.
@ymarian
it is confusing that the data picker displays the dates in local and all of its setters/getters are in UTC. one would expect that when he select a date, he will get the time using the same time zone. i was getting the time with offset 4 hours and the date was wrong until i got the idea of UTC is applied in all APIs.
if it is complex as you said, at least such logic should be reflected in the documentations. for example MaterialPickerOnPositiveButtonClickListener is not mentioning anything about UTC
Still confused by this. So the picker displays UTC dates by default, and if we wanted to use date in local timezone, we would have to convert the selected date on the picker to local date. Wouldn't that mean the user could select a certain day and local time could show the previous day? Wouldn't that be confusing for the user?
Struggling to figure this one out
Most helpful comment
Hi @Manu-Jindal this commit (https://github.com/material-components/material-components-android/commit/712a2ce92040b6fc90530ad853633ecd7f258dfc) was made after the 1.3.0-alpha01 cut. It is in our daily release, could you please try it to verify whether it fixes the problem you are facing?
Here are some instructions for how to use the daily build:
https://github.com/material-components/material-components-android/issues/824#issuecomment-567044986