title: Angular 2 Ionic 2 - How to set max or min date to today for date input?
body: <pre><code> &lt;input class="alert-input date-input" #dob="ngModel" name="dob" max="2018-03-07" [(ngModel)]="leadDetail.dob" type="date"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>How can I set the max date for today instead of 2018-03-07 dynamically?</p>
  
  <p>I tried following methods-</p>
  
  <pre><code> &lt;input  max="today" type="date"&gt;&lt;/div&gt;
   &lt;input  max="{{today | date:'yyyy-mm-dd'}}" type="date"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>Class -</p>
  
  <pre><code>public today = new Date();
  </code></pre>
  
  <p>but no luck.</p>