Skip to content

Commit

Permalink
fix(ui5-daypicker): date selection range light blue indication (#6836)
Browse files Browse the repository at this point in the history
When selecting a date range in the Calendar with selection mode Range, if you select a new start date (and thus have only one date selected), a range of dates have their background color set to light blue indicating they are in the selected date range. This is incorrect since there is only one date selected and therefore no date range yet.

Fixes #6781
  • Loading branch information
kieransukachevin authored and PetyaMarkovaBogdanova committed Jun 20, 2023
1 parent 4953dc4 commit d630561
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/main/src/DayPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ class DayPicker extends CalendarPart implements ICalendarPicker {
* @private
*/
_updateSecondTimestamp() {
if (this.selectionMode === CalendarSelectionMode.Range && this.selectedDates.length === 1) {
if (this.selectionMode === CalendarSelectionMode.Range && (this.selectedDates.length === 1 || this.selectedDates.length === 2)) {
this._secondTimestamp = this.timestamp;
}
}
Expand Down

0 comments on commit d630561

Please sign in to comment.