-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
Setting timeZoneName doesn't seem to affect the datetimepicker #859
Comments
I noticed the same thing. |
same issue |
Any update on this issue? Is there any fix for this ? |
same issue as well for France, |
Aside from installing moment, may I know what else you did @Marinatim? I asked because I already got moment installed before trying this date picker package, and it still had that issue. |
The issue was reproducible when on different timeZones. Solved by converting the time to UTC. Get the timezone offset, current locale's timezone and UTC.
|
Thanks @neemanwa, but the issue still remains I think. The selected date is February 12, right. We have no way of setting what the current date is. I think this is correct because it should be based on |
@arielAzarconColcap const handleConfirm = (date) => { const [isDateStart, setDateStart] = useState(); |
Hi! |
Please see this:
I temporarily set the phone's timezone in such a way that the date is still the day before as compared to the current day in AU (+11:00, Australia/Sydney tz).
Then I open the DateTimePicker like this:
DateTimePickerAndroid.open({ value: variableToUse, minimumDate, timeZoneName: "Australia/Sydney", onChange: (ev, newDate) => { if (ev.type === 'set') { if(onChangeDateFn) onChangeDateFn(newDate) } } })
However, upon opening the Datepicker, it still highlights the previous day as if setting timeZoneName to Australia/Sydney did not have any effect:
Is this intentional? My expectation is that it should now follow +11:00 timezone, and as such, the current day should be February 12, not February 11.
I cannot select it anymore though. that means the minimumDate props is working, but it should be greyed out as well, like the previous days before it.
I'm using:
Expo: 50.0.6
@react-native-community/datetimepicker: 7.6.2
Android: 11
The text was updated successfully, but these errors were encountered: