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

Method _selectYearRange

packages/main/src/YearRangePicker.ts:409–424  ·  view source on GitHub ↗

* User selected range with the mouse or pressed Enter/Space. * @param e * @private

(e: Event)

Source from the content-addressed store, hash-verified

407 * @private
408 */
409 _selectYearRange(e: Event) {
410 e.preventDefault();
411 const target = e.target as HTMLElement;
412
413 if (target.className.indexOf("ui5-yrp-item") === -1) {
414 return;
415 }
416
417 let timestamp = this._getTimestampFromDom(target);
418 timestamp = this._getYearPickerCenteredTimestamp(timestamp);
419
420 this._safelySetTimestamp(timestamp);
421 this.fireDecoratorEvent("change", {
422 timestamp: this.timestamp!,
423 });
424 }
425
426 /**
427 * Returns the centered timestamp for the year picker.

Callers 2

_onkeydownMethod · 0.95
_onkeyupMethod · 0.95

Calls 3

_getTimestampFromDomMethod · 0.80
_safelySetTimestampMethod · 0.80

Tested by

no test coverage detected