Skip to content

Commit

Permalink
Fixed #2279 - Date gets deselected in Calendar with selection mode range
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Nov 6, 2021
1 parent d36f024 commit 93754e1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1526,8 +1526,14 @@ export class Calendar extends Component {
let startDate = this.props.value[0];
let endDate = this.props.value[1];

if (!endDate && date.getTime() >= startDate.getTime()) {
endDate = date;
if (!endDate) {
if (date.getTime() >= startDate.getTime()) {
endDate = date;
}
else {
endDate = startDate;
startDate = date;
}
}
else {
startDate = date;
Expand Down

0 comments on commit 93754e1

Please sign in to comment.