MCPcopy Create free account
hub / github.com/UI5/webcomponents / _updateSelectedDates

Method _updateSelectedDates

packages/main/src/DayPicker.ts:534–551  ·  view source on GitHub ↗
(timestamp: number, isShift: boolean)

Source from the content-addressed store, hash-verified

532 }
533
534 _updateSelectedDates(timestamp: number, isShift: boolean) {
535 if (this.selectionMode === CalendarSelectionMode.Multiple) {
536 if (this.selectedDates.length > 0 && isShift) {
537 this._multipleSelection(timestamp);
538 } else {
539 this._toggleTimestampInSelection(timestamp);
540 }
541 return;
542 }
543
544 announce(DayPicker.i18nBundle.getText(LIST_ITEM_SELECTED), InvisibleMessageMode.Assertive);
545 if (this.selectionMode === CalendarSelectionMode.Range && this.selectedDates.length === 1) {
546 this.selectedDates = [this.selectedDates[0], timestamp];
547 return;
548 }
549
550 this.selectedDates = [timestamp];
551 }
552
553 /**
554 * Selects/deselects the whole row (week).

Callers 1

_selectDateMethod · 0.95

Calls 4

_multipleSelectionMethod · 0.95
announceFunction · 0.85
getTextMethod · 0.80

Tested by

no test coverage detected