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

Method _selectMonth

packages/main/src/MonthPicker.ts:369–386  ·  view source on GitHub ↗

* Selects a month, when user made selection with mouse or using Space/Enter. * @param e * @private

(e: Event)

Source from the content-addressed store, hash-verified

367 * @private
368 */
369 _selectMonth(e: Event) {
370 e.preventDefault();
371 const target = e.target as HTMLElement;
372
373 if (!target.classList.contains("ui5-mp-item")) {
374 return;
375 }
376
377 const timestamp = this._getTimestampFromDom(target);
378 this._safelySetTimestamp(timestamp);
379 this._updateSecondTimestamp();
380 this._updateSelectedDates(timestamp);
381
382 this.fireDecoratorEvent("change", {
383 timestamp: this.timestamp!,
384 dates: this.selectedDates,
385 });
386 }
387
388 _updateSelectedDates(timestamp: number) {
389 if (this.selectionMode === CalendarSelectionMode.Range && this.selectedDates.length === 1) {

Callers 2

_onkeydownMethod · 0.95
_onkeyupMethod · 0.95

Calls 5

_updateSelectedDatesMethod · 0.95
containsMethod · 0.80
_getTimestampFromDomMethod · 0.80
_safelySetTimestampMethod · 0.80

Tested by

no test coverage detected