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

[BUG] Datepicker: no sync between selected date and displayed date #277

Closed
Ashygoyal opened this issue Oct 15, 2019 · 1 comment
Closed
Assignees
Labels
bug Something isn't working in progress Work on this issue is in progress
Milestone

Comments

@Ashygoyal
Copy link
Contributor

Description
There is no sync between the date selected in the datepicker and the date displayed in the i nput field. Also, on first opening the datepicker, it should ideally show the current/ present date already selected but it shows a different month, date, year.
Note: This behaviour is noticed when the timezone in the machine is default (set to IST=> UTC: 5:30). If timezone is changed to EST, datepicker works fine.

To Reproduce
Steps to reproduce the behavior:

  1. Set system timezone to IST
  2. Open datepicker. The Month and year on top of the datepicker wont be the current ones.
  3. Select any date in datepicker, check the input field. Dates will be different.

Expected behavior
Datepicker must work the same, irrespective of the locales/ timezones/ OS language, etc.

Screenshots
For further details, please access the screencast at this link: https://tangoe-my.sharepoint.com/:v:/p/ashish_goyal/Ef3jHXFyGFtLgNES10HEV-sBIN05ToCAmopt_0Zv45EhZQ?e=eVhSnb

@Ashygoyal Ashygoyal added bug Something isn't working new issue This issue has yet to receive attention labels Oct 15, 2019
@patrick-lewandowski
Copy link
Contributor

@grahamhency changing all timeZone values from utc to Intl.DateTimeFormat().resolvedOptions().timeZone in projects/go-lib/src/lib/components/go-datepicker/date-adapter.ts would fix this issue.

Not sure what implications this would have on the behavior of the date picker itself which is why I posted findings here so we can discuss it. Dealing with time gives me too much of a headache 😃

@grahamhency grahamhency added in progress Work on this issue is in progress and removed new issue This issue has yet to receive attention labels Oct 23, 2019
@grahamhency grahamhency added this to the v1.3.0 milestone Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress Work on this issue is in progress
Projects
None yet
Development

No branches or pull requests

3 participants