(amount: number, unit: string)
| 937 | } |
| 938 | |
| 939 | _modifyValueBy(amount: number, unit: string) { |
| 940 | const date = this.getValueFormat().parse(this._effectiveValue) as Date; |
| 941 | if (!date) { |
| 942 | return; |
| 943 | } |
| 944 | if (unit === "hour") { |
| 945 | date.setHours(date.getHours() + amount); |
| 946 | } else if (unit === "minute") { |
| 947 | date.setMinutes(date.getMinutes() + amount); |
| 948 | } else if (unit === "second") { |
| 949 | date.setSeconds(date.getSeconds() + amount); |
| 950 | } |
| 951 | |
| 952 | const newValue = this.formatValue(date); |
| 953 | |
| 954 | this._updateValueAndFireEvents(newValue, true, ["change", "value-changed"]); |
| 955 | } |
| 956 | |
| 957 | /** |
| 958 | * The listener for this event can't be passive as it calls preventDefault() |
no test coverage detected