* Tells if the day is inside a selection range (light blue). * @param timestamp * @private
(timestamp: number)
| 485 | * @private |
| 486 | */ |
| 487 | _isDayInsideSelectionRange(timestamp: number): boolean { |
| 488 | // No selection at all (or not in range selection mode) |
| 489 | if (this.selectionMode !== CalendarSelectionMode.Range || !this.selectedDates.length) { |
| 490 | return false; |
| 491 | } |
| 492 | |
| 493 | // Only one date selected - the user is hovering with the mouse or navigating with the keyboard to select the second one |
| 494 | if (this.selectedDates.length === 1 && this._secondTimestamp) { |
| 495 | return isBetween(timestamp, this.selectedDates[0], this._secondTimestamp); |
| 496 | } |
| 497 | |
| 498 | // Two dates selected - stable range |
| 499 | return isBetween(timestamp, this.selectedDates[0], this.selectedDates[this.selectedDates.length - 1]); |
| 500 | } |
| 501 | |
| 502 | /** |
| 503 | * Selects/deselects a day. |
no test coverage detected