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

Method _modifyDateValue

packages/main/src/DateTimePicker.ts:417–430  ·  view source on GitHub ↗

* @override

(amount: number, unit: string, preserveDate: boolean)

Source from the content-addressed store, hash-verified

415 * @override
416 */
417 _modifyDateValue(amount: number, unit: string, preserveDate: boolean) {
418 if (!this.dateValue) {
419 return;
420 }
421
422 const modifiedDate = modifyDateBy(CalendarDate.fromLocalJSDate(this.dateValue), amount, unit, preserveDate, this._minDate, this._maxDate);
423 const modifiedLocalDate = modifiedDate.toLocalJSDate();
424 modifiedLocalDate.setHours(this.dateValue.getHours());
425 modifiedLocalDate.setMinutes(this.dateValue.getMinutes());
426 modifiedLocalDate.setSeconds(this.dateValue.getSeconds());
427
428 const newValue = this.formatValue(modifiedLocalDate);
429 this._updateValueAndFireEvents(newValue, true, ["change", "value-changed"]);
430 }
431
432 /**
433 * @override

Callers

nothing calls this directly

Calls 5

modifyDateByFunction · 0.85
fromLocalJSDateMethod · 0.80
toLocalJSDateMethod · 0.80
formatValueMethod · 0.45

Tested by

no test coverage detected