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: auto-update-date format='yyyy-mm-dd' on-date-changed #55

Closed
rmgalante opened this issue Oct 3, 2016 · 2 comments
Closed

Bug: auto-update-date format='yyyy-mm-dd' on-date-changed #55

rmgalante opened this issue Oct 3, 2016 · 2 comments

Comments

@rmgalante
Copy link

I initialize the input-date to today's date. The element shows the correct date. I click the next month button until I reach October of next year. I choose October 2. The event handler, onDateChanged, shows e.detail.value = '2016-10-02'. But I'm in the year, 2017. It should show '2017-10-02'.

This only happens the first time you click a day in the month of the next year. After that, it works and shows the correct year.

@rmgalante rmgalante reopened this Oct 20, 2016
@rmgalante
Copy link
Author

rmgalante commented Oct 20, 2016

I would like to clarify the problem I see. I've been debugging this and here is what I found. I put some debugging statements in the event handler for the event, date-changed.

I load the page, and the console log shows 2016-10-20.

I change the month from October of 2016 to October of 2017 by clicking the right arrow in the upper right corner until the month of October is shown (same month next year). I click on the day, 31. The console shows one event fired with a value of 2016-10-31. Why is it not reporting 2017-10-31? This is the date that appears in the left panel => 2017, Mon, Oct 31). That is wrong! It's not Monday.

I reload the page and click on the year and change it to 2017. Then if I click on the day, 31, I see the correct date, which is 2017-10-31. And the date that appears in the left panel => 2017, Tue, Oct 31. This is right. It is Tuesday.

So the changed year is detected, when I click the year and change it. But the changed year is not detected when I change the month from October of 2016 to October of 2017 by clicking the right arrow button. So when I click the day of the month, I get the previous year. And the left panel is not showing the correct date.

This only happens the first time I click a day. If I click a different day of the same month, the changed year is detected.

@motss
Copy link
Owner

motss commented Oct 20, 2016

@rmgalante Issue confirmed. A patch is in progress. Thank you for reporting.

@motss motss self-assigned this Oct 21, 2016
@motss motss removed the in progress label Nov 5, 2016
@motss motss closed this as completed in #66 Nov 5, 2016
motss added a commit that referenced this issue Nov 5, 2016
* 🦄 Fixed #55 where _selectedDate is not being updated on date selected

* 🦄 Fixed #62 to add more entry points to style vanilla datepicker

* 💢 Fixed wrong weekdays

* 🦄 To fix #53, #54 and added test for random format
motss added a commit that referenced this issue Nov 5, 2016
* 🦄 Fixed #55 where _selectedDate is not being updated on date selected

* 🦄 Fixed #62 to add more entry points to style vanilla datepicker

* 💢 Fixed wrong weekdays

* 🦄 To fix #53, #54 and added test for random format

:unicorn: Fixed #55 where _selectedDate is not being updated on date selected
motss added a commit that referenced this issue Nov 5, 2016
* 🦄 Fixed #55 where _selectedDate is not being updated on date selected

* 🦄 Fixed #62 to add more entry points to style vanilla datepicker

* 💢 Fixed wrong weekdays

* 🦄 To fix #53, #54 and added test for random format

:unicorn: Fixed #55 where _selectedDate is not being updated on date selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants