-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[DatePicker] Is the DatePicker timezone aware? #5726
Comments
Did some experimentation and found that:
I am wondering what's the best practice to avoid timezone errors when working with this datepicker. I am storing dates internally in ISO 8601 format without the time part, e.g. 2016-12-31. That way I don't have to deal with timezone at all. I am not sure if simply chopping off the time part is a good idea. |
Use moment: import moment from 'moment';
moment(this.state.filter.fromTime).format('YYYY-MM-DD HH:mm:ss') |
I ended up doing something very similar - because I am interested in just the date (in ISO 8601 format):
|
Timezones and daylight savings are very common issues while working with javascript In Brazil for example, this year the daylight saving starts on October 15th. If you open the date-picker documentation in a Safari, you will see double 14th in the Calendar: This happens because Oct 14th is GMT-3 and Oct 15th is GMT-2. As a workaround, I re-implemented the If I decide to keep going with this component, I will most likely end up write a more elegant solution. 😅 |
Closing for #4787 |
The text was updated successfully, but these errors were encountered: