title: angular-ui datepicker max-date doesn't work properly
body: <p>I am trying to get the <code>min-date</code> and <code>max-date</code> to be set from the <code>datepicker-options</code>, but have been unsuccessful. A code snippet is attached.</p>
  
  <p>Any help? Thanks!</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>angular.module('ui.bootstrap.demo', ['ui.bootstrap']);
  angular.module('ui.bootstrap.demo').controller('DatepickerDemoCtrl', function ($scope) {
    $scope.today = function() {
      $scope.dt = new Date();
    };
    $scope.today();
  
    $scope.dateOptions = {
      formatYear: 'yy',
      minDate: '05/01/2015',
      startingDay: 1
    };
  
    $scope.formats =['dd/MM/yyyy', 'dd-MMMM-yyyy', 'yyyy/MM/dd', 'dd.MM.yyyy', 'shortDate'];
    $scope.format = $scope.formats[0];
  
    var tomorrow = new Date();
    tomorrow.setDate(tomorrow.getDate() + 1);
    var afterTomorrow = new Date();
    afterTomorrow.setDate(tomorrow.getDate() + 2);
    $scope.events =
      [
        {
          date: tomorrow,
          status: 'full'
        },
        {
          date: afterTomorrow,
          status: 'partially'
        }
      ];
  
    $scope.getDayClass = function(date, mode) {
      if (mode === 'day') {
        var dayToCheck = new Date(date).setHours(0,0,0,0);
  
        for (var i=0;i&lt;$scope.events.length;i++){
          var currentDay = new Date($scope.events[i].date).setHours(0,0,0,0);
  
          if (dayToCheck === currentDay) {
            return $scope.events[i].status;
          }
        }
      }
  
      return '';
    };
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!doctype html&gt;
  &lt;html ng-app="ui.bootstrap.demo"&gt;
    &lt;head&gt;
      &lt;script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.13/angular.js"&gt;&lt;/script&gt;
      &lt;script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.0.js"&gt;&lt;/script&gt;
      &lt;link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"&gt;
    &lt;/head&gt;
    &lt;body&gt;
  
  &lt;style&gt;
    .full button span {
      background-color: limegreen;
      border-radius: 32px;
      color: black;
    }
    .partially button span {
      background-color: orange;
      border-radius: 32px;
      color: black;
    }
  &lt;/style&gt;
  &lt;div ng-controller="DatepickerDemoCtrl"&gt;
      &lt;pre&gt;Selected date is: &lt;em&gt;{{dt | date:'fullDate' }}&lt;/em&gt;&lt;/pre&gt;
  
      &lt;h4&gt;Inline&lt;/h4&gt;
      &lt;div style="display:inline-block; min-height:290px;"&gt;
        &lt;datepicker ng-model="dt" datepicker-options="dateOptions" class="well well-sm" custom-class="getDayClass(date, mode)"&gt;&lt;/datepicker&gt;
      &lt;/div&gt;
  &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>