-
Notifications
You must be signed in to change notification settings - Fork 67
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
Time zone issue causing hour and minutes to be off #68
Comments
Tried to replicate in a standalone environment without luck. Maybe I am just doing something stupid. Would be good if it was possible to disable any tz handling and just have the picker work with raw hours/minutes leaving it up to caller/user to deal with. Note: the minutes diff in the screenshot and actual time is due to me writing the comment.. |
This most likely not an issue with react-times. I am seeing other very strange things right now. |
Reopening this after some more digging. I believe this is part of the problem (from time.js/getValidTimeData): For Singapore and KualaLumpur this will cause 30min off. As they changed their offset in 1982. A potential fix could be to pass in a reference date which is used instead of 1970-01-01. Br |
Wow! Thanks a lot for your research! It seems really a problem and can not fixed quickly in react-times it self, but may be it's a good idea to allow module user handle it by themselves. And I think we can invite @carlodicelico and @erin-doyle to discuss this problem -- they did a lot great work to embed timezone function in react-times. |
If changed to 'let user deal with it' - you would break backwards compatibility, which is problematic in itself. One option would be to have a property called 'reference time'. Default this property to currently used 1970-01-01. This would retain backwards compatibility but also allow for users to override. In my case I would simply set it to 'moment()'. |
Hi,
Having an issue with time-zone (using 2.2.2).
If TZ = Asia/Kuala_Lumpur the time will always be off by 30minutes.
Example (just outline):
Set the machine to use Asia/Kuala_Lumpur as the TZ and the picker is off by 30 minutes.
Using 'material' as rendering.
My complete setup of timepicker is:
Also when setting
showTimezone={true}
react bails out.warning.js?8a56:36 Warning: Failed prop type: Invalid prop
children
supplied toCSSTransitionGroupChild
, expected a ReactNode.in CSSTransitionGroupChild (created by TransitionGroup)
in TransitionGroup (created by CSSTransitionGroup)
in CSSTransitionGroup (created by Timezone)
in div (created by Timezone)
in Timezone (created by TwentyFourHoursMode)
in div (created by TwentyFourHoursMode)
in TwentyFourHoursMode (created by MaterialTheme)
in div (created by MaterialTheme)
in MaterialTheme (created by TimePicker)
in div (created by OutsideClickHandler)
in OutsideClickHandler (created by TimePicker)
in div (created by TimePicker)
in TimePicker (created by TimePickerWrapper)
Screenshot (correct time is the OS clock in upper right corner):
Br
Fredrik
The text was updated successfully, but these errors were encountered: