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

Method _selectYear

packages/main/src/YearPicker.ts:362–379  ·  view source on GitHub ↗

* User clicked with the mouser or pressed Enter/Space * @param e * @private

(e: Event)

Source from the content-addressed store, hash-verified

360 * @private
361 */
362 _selectYear(e: Event) {
363 e.preventDefault();
364 const target = e.target as HTMLElement;
365
366 if (target.className.indexOf("ui5-yp-item") === -1) {
367 return;
368 }
369
370 const timestamp = this._getTimestampFromDom(target);
371 this._safelySetTimestamp(timestamp);
372 this._updateSecondTimestamp();
373 this._updateSelectedDates(timestamp);
374
375 this.fireDecoratorEvent("change", {
376 timestamp: this.timestamp!,
377 dates: this.selectedDates,
378 });
379 }
380
381 _updateSelectedDates(timestamp: number) {
382 if (this.selectionMode === CalendarSelectionMode.Range && this.selectedDates.length === 1) {

Callers 2

_onkeydownMethod · 0.95
_onkeyupMethod · 0.95

Calls 4

_updateSelectedDatesMethod · 0.95
_getTimestampFromDomMethod · 0.80
_safelySetTimestampMethod · 0.80

Tested by

no test coverage detected