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

_dateChanged function in paper-calendar doesn't validate maxDate and minDate #199

Open
xd1gital opened this issue Oct 5, 2017 · 1 comment

Comments

@xd1gital
Copy link

xd1gital commented Oct 5, 2017

this.maxDate and this.minDate need to be validated (null checking) before calling .getFullYear()

 _dateChanged: function(date, oldValue) {
        if (!this._isValidDate(date)) {
          console.warn('Invalid date: ' + date);
          this.date = date = oldValue;
        }
        if (!this._withinValidRange(date)) {
          console.warn('Date outside of valid range: ' + date);
          if(date.getFullYear() == **this.maxDate**.getFullYear()) {
            this.date = this.maxDate;
          } else if(date.getFullYear() == **this.minDate**.getFullYear()){
            this.date = this.minDate;
          } else {
            this.date = date = oldValue;
          }
        }
...
@admwx7 admwx7 added this to the 2.0.0 milestone Oct 30, 2017
@admwx7 admwx7 removed the PR needed label Oct 30, 2017
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