Open milleraundra opened 7 years ago
The lines causing this (reproducable) bug are the following: If the min-date is greater than the first day of the current month (while at the same time, max-date is in the same month as min-date), the function _withinValidRange() on line #653 will return false, because the validity check function _monthWithinValidRange on line #659 only checks the first and the last of each month if they're within min-date and max-date and doesn't care about the current date being valid, though.
I didn't think of a solution yet, but I hope this helps someone who is able to solve this problem, because I am not that good of a programmer to be able to change this.
While this is not fixed yet, try setting your min-date to the first of the current month at least (which works of course)
minDate: {
type: Date,
value: function() {
var d = new Date();
return new Date(
d.getFullYear(), d.getMonth()
);
}
}
@moritzmenzel Thank you for providing an answer!
My project where I tried to use the component like this was time sensitive, so I had to find a replacement. This does seem to be an important use case that should be worked out though.
Is this still an issue for you @milleraundra? If so I'll tag it and prioritize it with everything else for our next release into 2.0 since this is a pretty critical one if it's still around.
I am not working with Polymer at this time, so this is not an issue for me anymore. Thanks!
Took a look at the logic, it looks like this is still an issue, I'll do a deeper dive on it and see if I can reproduce and address the problem when I get some free time.
When setting the min/max attributes individually, the calendar behaves correctly. When both values are provided, the calendar is blank. See the attached files.
Is there something I'm missing?