Я хочу увеличивать и уменьшать дату при нажатии кнопки и устанавливать значение в поле ввода, это код
prev() {
let diff = 1; //1 to increment and -1 to decrement
this.date.setDate(this.date.getDate() - diff);
console.log(this.date);
}
next() {
let diff = 1; // 1 to increment and -1 to decrement
this.date.setDate(this.date.getDate() + diff);
console.log(this.date);
}
В html файле
<input type='text' id='datepicker' name='datepicker' class="form-control"
[ngModel]="{{date | dd-MM-yyyy}}">
<button (click)="prev()"></button>
<button (click)="next()"></button>