bendavis78 / paper-date-picker

Material design date picker component for polymer
http://bendavis78.github.io/paper-date-picker/
MIT License
225 stars 132 forks source link

paper-calender _tapDay issue #203

Open cvPriyanka opened 6 years ago

cvPriyanka commented 6 years ago

Hi,

Suppose the previous date is Oct 31 and we have to set the new date to Nov 1.

    var newDate = new Date(this.date.getTime());
    newDate.setYear(item.year);
    newDate.setMonth(item.month);
    newDate.setDate(item.day);

Here while setting month to Nov, since Nov 31st doesn't exist, it is set to Dec 1.

This can be avoided by setting month as:

newDate.setMonth(item.month, item.day);

I am not sure if its the right way. Please help

admwx7 commented 6 years ago

@cvPriyanka how are you triggering this case in the UI? The calendar element shouldn't allow you to select a date that's not actually valid, however if it is and you have steps to reproduce I can debug it and address the issue. Just don't want to make changes if I can't test that I actually fixed it...

cvPriyanka commented 6 years ago

@admwx7 Select Oct 31st and save it. Then reopen paper-date-picker element , now the current value is Oct 31. Try to select Nov 1