-
Notifications
You must be signed in to change notification settings - Fork 41
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
Input displaying one day off #14
Comments
I'm still seeing this issue. I initialize with selectedDate='2000-01-20', and the dropdowns show January 19 2000. |
@JMcAmmond is right, it relates to Time Zones. Specifically, the Date(selectedDate) constructor which Mozilla recommends not using: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse This issue is probably browser and data dependent but will reproduce on Chrome when using the recommended yyyy-mm-dd format. A workaround is to use slashes instead of dashes as the delimiter; this causes Date.parse to interpret the date in local time. Adding .replace(/-/g, '/') to my date string worked well. |
@biomiker Is this still a problem ? Do you have a workaround ? |
The workaround I mentioned on Jul 31 is still necessary. I use yyyy/mm/dd instead of yyyy-mm-dd. |
When selecting a date, the value is being returned correctly but it displays as one day off. This is probably because when the date objects are built they accept a string that doesn't account for time zones.
The text was updated successfully, but these errors were encountered: