-
Notifications
You must be signed in to change notification settings - Fork 132
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
suggested fix for #124 #168
base: master
Are you sure you want to change the base?
Conversation
@@ -652,7 +669,27 @@ | |||
}, | |||
_withinValidRange: function(date) { | |||
if (this._isValidDate(date)) { | |||
return (!this.minDate || date >= this.minDate) && (!this.maxDate || date <= this.maxDate); | |||
return (!this.minDate || date >= this.minDate) && (!this.maxDate || date <= this.maxDate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove double space
@@ -289,6 +289,22 @@ | |||
value: null | |||
}, | |||
/** | |||
*Array of selectable dates | |||
* (whitelist) | |||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Format must be String YYYY-MM-DD
here as well as on invalidDates
so it's documented for people using this element stand-alone.
return false; | ||
}, | ||
|
||
_confirmsToWhiteAndBlacklist: function(date){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collapse these 3 into:
/**
* Ensures that our date is valid and passes both white and black list checks.
* @protected
*
* @param {Date} date
* @return {Boolean}
*/
_checkWhiteBlackLists: function(date) {
return this._isValidDate(date) &&
(this.validDates || []).indexOf(this.dateFormat(date,'YYYY-MM-DD')) < 0 &&
(this.invalidDates || []).indexOf(this.dateFormat(date,'YYYY-MM-DD')) < 0;
}
So we aren't biting the cost of always checking both lists, and checking for a valid date 3 times when we don't have to.
Fixes #113 |
You're completely right, will change tonight. |
Hey Ben, stumbled across this fr and thought what the hell - any remarks, would be happy to help some more?
#124