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

Method onSelectedDatesChange

packages/main/src/DateTimePicker.ts:332–356  ·  view source on GitHub ↗

* @override

(e: CustomEvent<CalendarSelectionChangeEventDetail>)

Source from the content-addressed store, hash-verified

330 * @override
331 */
332 async onSelectedDatesChange(e: CustomEvent<CalendarSelectionChangeEventDetail>) {
333 e.preventDefault();
334
335 // Try to get the current time value from the time picker,
336 // but fallback to last valid value if current picker time is empty or invalid
337 let timeValue = this._clocks?.value || "";
338 if (!timeValue || !this.isValidValue(timeValue)) {
339 timeValue = this._lastValidValue || this.getValueFormat().format(UI5Date.getInstance());
340 }
341
342 this._previewValues = {
343 ...this._previewValues,
344 calendarTimestamp: e.detail.timestamp,
345 calendarValue: e.detail.selectedValues[0],
346 timeSelectionValue: timeValue,
347 };
348 this._showTimeView = true;
349
350 if (this.showDateView) {
351 return;
352 }
353
354 await renderFinished();
355 this._clocks.focus();
356 }
357
358 onTimeSelectionChange(e: CustomEvent<TimeSelectionChangeEventDetail>) {
359 this._previewValues = {

Callers

nothing calls this directly

Calls 5

getValueFormatMethod · 0.95
renderFinishedFunction · 0.85
isValidValueMethod · 0.45
formatMethod · 0.45
focusMethod · 0.45

Tested by

no test coverage detected