Skip to content

Commit 71d3488

Browse files
committed
fix(select-range): preserve user defined class
1 parent 4f23264 commit 71d3488

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/components/select-range.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,16 @@ export default {
3939
const end = this.localSelection[1] || this.dateUnderCursor;
4040
4141
return Object.assign({}, data, {
42-
class: {
43-
hover: this.dateUnderCursor && date.isSame(this.dateUnderCursor),
44-
start: this.localSelection.length > 0 && date.isSame(start, 'day'),
45-
end: this.localSelection.length > 1 && date.isSame(end, 'day'),
46-
selected: this.localSelection.length > 1 && date.isBetween(start, end, 'days', '[]'),
47-
highlight: this.dateUnderCursor && this.localSelection.length === 1 && date.isBetween(start, this.dateUnderCursor, 'days', '[]'),
48-
},
42+
class: [
43+
data.class,
44+
{
45+
hover: this.dateUnderCursor && date.isSame(this.dateUnderCursor),
46+
start: this.localSelection.length > 0 && date.isSame(start, 'day'),
47+
end: this.localSelection.length > 1 && date.isSame(end, 'day'),
48+
selected: this.localSelection.length > 1 && date.isBetween(start, end, 'days', '[]'),
49+
highlight: this.dateUnderCursor && this.localSelection.length === 1 && date.isBetween(start, this.dateUnderCursor, 'days', '[]'),
50+
},
51+
],
4952
});
5053
},
5154
onHover(date) {

0 commit comments

Comments
 (0)