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

useUtc not correctly taken into account when typing input #666

Open
ij1 opened this issue Jan 18, 2019 · 1 comment
Open

useUtc not correctly taken into account when typing input #666

ij1 opened this issue Jan 18, 2019 · 1 comment

Comments

@ij1
Copy link

ij1 commented Jan 18, 2019

I came across a bug that after typing in a date, the picker selects a day that is off by one (returned timestamp is off by the timezone offset).

The cause is that the Date.parse / new Date parameter does not consider this.useUtc flag. Thus the parser creates a timestamp which is off by the local timezone offset (and that lands to a different day). I tested appending this (to the parameters given in parseTypedDate): + (this.useUtc ? ' UTC' : ''). The picker then showed the correct day after typing in the date. Such solution seems somewhat hackish though so I didn't want to create pull request out of it. Any ideas how to do a more clean solution than appending UTC timezone identifier into the string?

There are multiple open issues which seem to be similar but I couldn't find any that provided 100% match to the problem I'm seeing so I opened new one focused on the particular problem I located.

@ij1
Copy link
Author

ij1 commented Jan 18, 2019

The PRs #536 or #653 might be used to workaround this problem but it's a bit heavy-handed solution to force creating the parsing function manually to avoid the bug in the useUtc flag.

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

No branches or pull requests

1 participant