title: AngularJS UI-Bootstrap, How to set minDate to 90 days ago and maxDate to today?
body: <p>I have an app that is Using AngularJS and UI-Bootstrap. I have a datePicker that needs restrictions on the dates. I'm very new to angular and wonder if anyone knows how I might do this. I'm looking for a way to set the minDate to 90 days ago and the maxDate to today's date.</p>
  
  <p><a href="http://plnkr.co/edit/mZAONsqFMZny62dLVtCW?p=preview" rel="nofollow">my plunker</a></p>
  
  <pre><code>var DatepickerDemoCtrl = function ($scope) {
    $scope.today = function() {
      $scope.dt = new Date();
    };
    $scope.today();
  
    $scope.clear = function () {
      $scope.dt = null;
    };
  
    // Disable weekend selection
    $scope.disabled = function(date, mode) {
      return ( mode === 'day' &amp;&amp; ( date.getDay() === 0 || date.getDay() === 6 ) );
  
    };
  
    $scope.toggleMin = function() {
      $scope.minDate = $scope.minDate ? null : new Date();
    };
    $scope.toggleMin();
  
  
  
         $scope.open = function($event,opened) {
      $event.preventDefault();
      $event.stopPropagation();
  
      $scope[opened] = true;
    };
  
  
    $scope.dateOptions = {
      formatYear: 'yy',
      startingDay: 1
    };
  
    $scope.initDate = new Date('2016-15-20');
    $scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
    $scope.format = $scope.formats[0];
  };
  </code></pre>