📅  最后修改于: 2022-03-11 14:48:20.294000             🧑  作者: Mango
As you are using Angular Reactive forms, you can listen for changes in the dateOne form control value through the valueChanges observable and set the dateTwo form control value.
this.form.get('dateOne')?.valueChanges.subscribe(date => {
const dateTwo = formatDate(new Date()+ 7, 'MM/dd/yyyy', 'en');
this.form.get('dateTwo')?.setValue(dateTwo);
});