title: Cannot set property 'date' of undefined when setting up AngularJS UI Bootstrap Datepicker
body: <p>Please consider this <a href="http://plnkr.co/edit/2LkwT05PKPTDI4x9VyOV?p=preview" rel="nofollow">Plunk</a>.</p>
  
  <p>I have this code to set up the datepicker (basically a (very minorly modified) verbatim copy paste from <a href="https://angular-ui.github.io/bootstrap/#/datepicker" rel="nofollow">UI Bootstrap</a>).</p>
  
  <p><em>I don't need all of the provided functionality, so it's stripped down a bit.</em></p>
  
  <pre><code>&lt;div class="input-group"&gt;
    &lt;input type="text"
           class="form-control"
           uib-datepicker-popup="{{format}}"
           ng-model="today"
           is-open="status.opened"
           min-date="minDate"
           max-date="maxDate"
           datepicker-options="dateOptions"
           ng-required="true" 
           close-text="Close" /&gt;
    &lt;span class="input-group-btn"&gt;
        &lt;button type="button" 
        class="btn btn-default" 
        ng-click="open($event)"&gt;
          &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;
        &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>With this defined in the controller:</p>
  
  <pre><code>app.controller("myController", [
        "$scope",
        "$http",
        function($scope, $http){
          var self = {};
  
          $scope.today = new Date();
  
          $scope.status = {
              opened: false
          };
  
          $scope.open = function ($event) {
              $scope.status.opened = true;
          };
  
          $scope.dateFormat = "dd/mm/yyyy";
      }]);
  </code></pre>
  
  <p>When running the Plunk, that results in the following error in console (Chrome F12):</p>
  
  <blockquote>
    <p>TypeError: Cannot set property 'date' of undefined</p>
  </blockquote>
  
  <p>See further below for the full message.</p>
  
  <p>As far as I can tell, this property <code>date</code> is not something I'm setting, so it must be something going wrong with the innerworkings of the DatePicker.</p>
  
  <p>Any idea how to fix this?</p>
  
  <p><em>Full error as promised, looks better when viewed in the <a href="http://plnkr.co/edit/2LkwT05PKPTDI4x9VyOV?p=preview" rel="nofollow">Plunk</a> though.</em></p>
  
  <blockquote>
    <p>TypeError: Cannot set property 'date' of undefined
        at init (<a href="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.14.3.min.js:9:3230" rel="nofollow">https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.14.3.min.js:9:3230</a>)
        at link (<a href="https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.14.3.min.js:9:4936" rel="nofollow">https://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.14.3.min.js:9:4936</a>)
        at <a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:58:185" rel="nofollow">http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:58:185</a>
        at W (<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:49:141" rel="nofollow">http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:49:141</a>)
        at f (<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:42:268" rel="nofollow">http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:42:268</a>)
        at f (<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:42:285" rel="nofollow">http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:42:285</a>)
        at W (<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:49:82" rel="nofollow">http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:49:82</a>)
        at f (<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:42:268" rel="nofollow">http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:42:268</a>)
        at f (<a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:42:285" rel="nofollow">http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:42:285</a>)
        at <a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:41:459" rel="nofollow">http://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.min.js:41:459</a>
    (anonymous function) @ angular.js:9383(anonymous
    function) @ angular.js:6825W @ angular.js:6215f @ angular.js:5622f @
    angular.js:5625W @ angular.js:6206f @ angular.js:5622f @
    angular.js:5625(anonymous function) @ angular.js:5527(anonymous
    function) @ angular.js:1301h.$eval @ angular.js:11906h.$apply @
    angular.js:12006(anonymous function) @ angular.js:1299d @
    angular.js:3697Xb.c @ angular.js:1297Xb @ angular.js:1311Rc @
    angular.js:1260(anonymous function) @ angular.js:20534a @
    angular.js:2339(anonymous function) @ angular.js:2610q @
    angular.js:309Xc.c @ angular.js:2609</p>
  </blockquote>