Skip to content
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

fix #75 Datepicker - selected date differs one day from shown date #133

Merged
merged 1 commit into from
Aug 10, 2015
Merged

fix #75 Datepicker - selected date differs one day from shown date #133

merged 1 commit into from
Aug 10, 2015

Conversation

mirsilstan
Copy link

The bug is caused by the method toISOString, which returns a string representation of a date having the timezone zero UTC offset, as denoted by the suffix "Z".
On the other hand, the calendar is populated with dates having the timezone of the user's machine.
That's why Tue Jul 07 2015 00:00:00 GMT+0300 becomes 2015-07-06T21:00:00.000Z.
I replaced date.toISOString().slice(0, 10) with moment(date).format('YYYY-MM-DD') and it works ok right now.

@alansouzati
Copy link
Member

thanks for your contribution @mirsilstan

alansouzati added a commit that referenced this pull request Aug 10, 2015
fix #75 Datepicker - selected date differs one day from shown date
@alansouzati alansouzati merged commit c5206ce into grommet:master Aug 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants