* Selects/deselects a day. * @param e * @param isShift true if the user did Click+Shift or Enter+Shift (but not Space+Shift) * @param setTimestamp whether to move focus (timestamp) to the selected day; false for mouse clicks where focus is independent * @private
(e: Event, isShift: boolean, setTimestamp = true)
| 507 | * @private |
| 508 | */ |
| 509 | _selectDate(e: Event, isShift: boolean, setTimestamp = true) { |
| 510 | let target = e.target as HTMLElement; |
| 511 | |
| 512 | if (!target.hasAttribute("data-sap-timestamp")) { |
| 513 | target = target.parentNode as HTMLElement; |
| 514 | } |
| 515 | |
| 516 | if (!this._isDayPressed(target)) { |
| 517 | return; |
| 518 | } |
| 519 | |
| 520 | const timestamp = this._getTimestampFromDom(target); |
| 521 | |
| 522 | if (setTimestamp) { |
| 523 | this._safelySetTimestamp(timestamp); |
| 524 | } |
| 525 | this._updateSecondTimestamp(); |
| 526 | this._updateSelectedDates(timestamp, isShift); |
| 527 | |
| 528 | this.fireDecoratorEvent("change", { |
| 529 | timestamp: this.timestamp, |
| 530 | dates: this.selectedDates, |
| 531 | }); |
| 532 | } |
| 533 | |
| 534 | _updateSelectedDates(timestamp: number, isShift: boolean) { |
| 535 | if (this.selectionMode === CalendarSelectionMode.Multiple) { |
no test coverage detected