Skip to content

Commit

Permalink
fix: get-class should be valid in range
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxiong10 committed Dec 16, 2019
1 parent 327937b commit c8f7122
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/calendar/calendar-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,17 @@ export default {
}
return 0;
},
getRangeClasses(cellDate, currentDates, classes) {
getRangeClasses(cellDate, currentDates, classnames) {
const classes = [].concat(this.getClasses(cellDate, currentDates, classnames));
if (
!/disabled|active|not-current-month/.test(classes) &&
!/disabled|active|not-current-month/.test(classnames) &&
currentDates.length === 2 &&
cellDate.getTime() > currentDates[0].getTime() &&
cellDate.getTime() < currentDates[1].getTime()
) {
return 'in-range';
classes.push('in-range');
}
return '';
return classes;
},
},
render() {
Expand Down

0 comments on commit c8f7122

Please sign in to comment.