I, am trying to disable dependent date picker power by bootstrap angular. My requirement is Select a date from first date picker. After that disable the past date from the selected date picker on another date picker.
<div class="form-group">
<label>Risk Windows (Start Date)</label>
<div class="input-group">
<input class="form-control" placeholder="yyyy-mm-dd" name="dp" formControlName="riskWindowStartDate" ngbDatepicker #d1="ngbDatepicker">
<div class="input-group-append">
<button class="btn btn-outline-secondary" (click)="d1.toggle()" type="button">
<i class="fas fa-calendar"></i>
</button>
</div>
</div>
<div *ngIf="f.riskWindowStartDate.invalid && (f.riskWindowStartDate.dirty || f.riskWindowStartDate.touched)" class="invalid-feedback">
<div *ngIf="f.riskWindowStartDate.errors.required"> Risk Window Start Date is a required field.
</div>
</div>
</div>
Another Date Picker
<div class="form-group">
<label>Risk Windows (End Date)</label>
<div class="input-group">
<input class="form-control" placeholder="yyyy-mm-dd" name="dp" formControlName="riskWindowEndDate" ngbDatepicker #d2="ngbDatepicker">
<div class="input-group-append">
<button class="btn btn-outline-secondary" (click)="d2.toggle()" type="button">
<i class="fas fa-calendar"></i>
</button>
</div>
</div>
<div *ngIf="f.riskWindowEndDate.invalid && (f.riskWindowEndDate.dirty || f.riskWindowEndDate.touched)" class="invalid-feedback">
<div *ngIf="f.riskWindowEndDate.errors.required"> Risk Window End Date is a required field.
</div>
</div>
</div>
I, did some research and found that, need to add minDate and maxDate as per the official document. But not able to found how to solve the dependent date selected.
As per the image the second datepicker date need to be disable from the 2018-08-16.
Some research link How to disable previous date in ngbDatepicker in Angular 4?
https://ng-bootstrap.github.io/#/components/datepicker/examples
