title: Angular: Validate a date input based on the selection of another date input
body: <p>I have two input fields: InvoiceDate and InvoiceDueDate. I need to validate the InvoiceDueDate such that it starts 30 days after the selected InvoiceDate.</p>
  
  <p>Currently, I have the InvoiceDueDate validated to not less than the InvoiceDate by binding it to [min]="invoice.invoiceDate"</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;div class="col-sm-2"&gt;
                      &lt;label&gt;Invoice Date&lt;/label&gt;&lt;br&gt;
                      &lt;input type="date" [disabled]="true" name="invoicedate" class="form-control readOnly-date" [(ngModel)]="invoice.invoiceDate" *ngIf="!invoice.financialPeriodId"&gt;
                      &lt;input type="date" name="invoicedate" min="{{startDate | date: 'yyyy-MM-dd'}}" max="{{endDate | date: 'yyyy-MM-dd'}}" class="form-control" [(ngModel)]="invoice.invoiceDate" *ngIf="invoice.financialPeriodId"&gt;
                  &lt;/div&gt;
  
                  &lt;div class="col-sm-2"&gt;
                      &lt;label&gt;Due Date&lt;/label&gt;&lt;br&gt;
                      &lt;input type="date" name="dueDate" class="form-control readOnly-date" [(ngModel)]="invoice.invoiceDueDate" *ngIf="!invoice.invoiceDate"&gt;
                      &lt;input type="date" name="dueDate" [min]="invoice.invoiceDate" class="form-control" [(ngModel)]="invoice.invoiceDueDate"&gt;
                  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>The InvoiceDueDate should be set to 30 days from the date selected on InvoiceDate. example: if (InvoiceDate is 01-10-2019) then InvoiceDueDate should be 02-11-2019</p>