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

Min / Max Together Break Calendar #170

Open
milleraundra opened this issue Feb 3, 2017 · 5 comments
Open

Min / Max Together Break Calendar #170

milleraundra opened this issue Feb 3, 2017 · 5 comments

Comments

@milleraundra
Copy link

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?

screen shot 2017-02-02 at 5 14 32 pm
screen shot 2017-02-02 at 5 15 17 pm

@ghost
Copy link

ghost commented Feb 3, 2017

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()
        );
    }
}

@milleraundra
Copy link
Author

milleraundra commented Feb 7, 2017

@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.

@admwx7
Copy link
Collaborator

admwx7 commented Sep 18, 2017

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.

@milleraundra
Copy link
Author

I am not working with Polymer at this time, so this is not an issue for me anymore. Thanks!

@admwx7
Copy link
Collaborator

admwx7 commented Sep 20, 2017

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.

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