-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #882 happened again in 1.2.0-beta01 #1360
Comments
I see that #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. Using version 1.3.0-alpha01 |
Hi @Manu-Jindal this commit (712a2ce) 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? |
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 Update: It seems that the value returened from MaterialPickerOnPositiveButtonClickListener is in UTC 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 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 |
I think doing setSelection(${epochMilliInUTC} + TimeZone.getDefault().getOffset(epochMiliInUTC)) does the trick! |
Having the same issue in material:1.3.0 ;( @wcshi also tried material:1.3.0-alpha02 ,material:1.4.0-alpha01 not working suppose select today and open range picker it displays yesterday |
I was confused by all of this as well and just want to sum up how to do things properly client side. To properly set the selection in UTC:
To properly retrieve selection in local time:
And I agree, this should really be part of the documentation. |
val finalDate = (SpecificDate?.time ?: 0L) val datePicker = datePicker { DatePicker is a wrapper DSL over the MaterialDialog......... |
Datepicker to highlight wrong the day as today
The text was updated successfully, but these errors were encountered: