* @param amount * @param unit * @param preserveDate whether to preserve the day of the month (f.e. 15th of March + 1 month = 15th of April) * @protected
(amount: number, unit: string, preserveDate?: boolean)
| 570 | * @protected |
| 571 | */ |
| 572 | _modifyDateValue(amount: number, unit: string, preserveDate?: boolean) { |
| 573 | if (!this.dateValue) { |
| 574 | return; |
| 575 | } |
| 576 | |
| 577 | const modifiedDate = modifyDateBy(CalendarDate.fromLocalJSDate(this.dateValue), amount, unit, preserveDate, this._minDate, this._maxDate); |
| 578 | const newValue = this.formatValue(modifiedDate.toUTCJSDate()); |
| 579 | this._updateValueAndFireEvents(newValue, true, ["change", "value-changed"]); |
| 580 | } |
| 581 | |
| 582 | _updateValueAndFireEvents(value: string, normalizeValue: boolean, events: Array<"change" | "value-changed" | "input">, updateValue: boolean = true) { |
| 583 | const valid = this._checkValueValidity(value); |
no test coverage detected