-
Notifications
You must be signed in to change notification settings - Fork 21
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
Selecting dates sometimes results in the wrong date being picked #2
Comments
This comment is. not. helpful. Could you please give us an example of code that you use and that doesn't work as expected so we know exactly where to look ? Thank you |
@bmonjoie way to keep it going.....that was really dumb. Instead of being mature and saying "we try to make this great, we're sorry it doesn't work. If you have any suggestions, feel free to open a PR.", you just continued it and made it worse... |
@ilanbiala, I understand your point of view even though I don't share it. Please comment if you have more information about the issue reported. |
@peepmyfooty, that's ok, don't worry, it's already forgotten ;) From your screenshot, it also appears that everything is shifted by one (day but also month and year). |
I am also noticing this problem. It seems to be off by one for month, day and year based on passing the date parameter of date="2015/1/20" it seems to have pre-selected December 19th 2014. In addition when I then pick a new date from the picker after reopening it I find it is off by just one day so if I pick January 15th 2015 after reopening the picker I see that January 14th 2015 is selected. I did not pass a locale parameter, but I am in US. Let me know if I can provide any further information to be of assistance. |
Looking into this right now, could someone who is encountering this problem run the following code snippets:
and
and
and
I hope one of these snippets will show us what is the difference between the systems. So far I have tried everything I could think of in changing my system (from timezones to even the time itself 😝 ), but it keeps working for me 😟 |
The 3rd test: new Date(Date.UTC(2014, 11, 0)); returns: Sat Nov 29 2014 18:00:00 GMT-0600 (CST) on my system. The other tests return the expected results. |
@peepmyfooty In that case, could you please try the demo running on this page: https://polymerdev-greats-1.c9.io/bower_components/paper-date-picker/demo.html. And I have to say now that I seriously do not comprehend the way the millisecond constructor of the Date object works... that code was written in the first place actually to prevent issues like this~ oh well... |
@peepmyfooty Secret confession: that was an issue I was aware of. I was hoping that this issue would be fixed before I would have to think up a hack to fix that issue, as a fix to that first issue would allow me to do the infinite scrolling in a neater way which should prevent this issue from occurring in the first place. If you won't miss it too much turning off infinite scrolling is definitely an easy way that should prevent this issue from happening. (It's a race issue, so it's not a guarantee, but pretty sure none the less) The other way is to set an arbitrary higher number in the |
Back regarding this issue, it seems it's solved, I have also commited it, but not yet tagged it (so it won't show up in bower). The reason is that there is a part in me that fears this fix is going to cause new issues, so want to confirm with a couple more people that it actually works for them 👼 |
Sounds good. I can definitely work with this. Thanks again for all the work put into this. The UI is beautiful and look forward to incorporating this into our application! |
Sorry, this is the first time I have had chance to check. I got the same results as peep (3rd test showed Nov 29th). The demo site you posted also works ok for me. I saw that the demo.html, paper-date-picker.html and paper-date-picker-dialog.html were all updated in the repository about 4 hours ago. I downloaded the newer files, but am still seeing the same issue. |
@blade1981m That's... odd. Sorry for not having more time right now, will take another look tonight I hope and see what I missed 😟 . I checked by hand and the version in GitHub does seem to be the correct one... Just to double check, it's not an issue with caches or something? I have seen some weird caching issues with HTML imports in chrome, so that's the only reason I am asking (during dev I just disable the cache completely). |
I did forget to make sure I had disabled the cache. I just tried it now with cache disabled and unfortunately I am still having the same issue. |
I have to say I am incredibly confused by this. Could you maybe dump as much information about your environment as possible? From browser version to system locale to timezones? I will try to reproduce the problem somehow~ because right now I am quite lost as to what else it could be. |
Client:- |
Experiencing the same problem; every single instance of the picker that I've tried off the demo page selects the previous day instead of the one I click. I was totally bummed out because this component is one of the last things I needed to get an app running! 😞 So I decided to take a look at the markup with the inspection tool, and I saw this oddity: So apparently January of this year begins on the 31st and ends on the 26th. 😜 Oddly enough I didn't even notice this when I first looked at the page; go figure! I must be blind. I have no idea why in the world this is happening. Windows 8.1 Professional Update 1 |
Has anyone looked further into this? |
I recently came across this issue and resolved it by using code defined in re-com demo: They define a function in that file: If you define this function in your app and then in the on-change callback you use it then the date should be the correct date rather than the previous Hope that helps |
When you pick a date the UI selects the previous day. Is this a feature?
The text was updated successfully, but these errors were encountered: