title: Close date picker when clicking to next date picker AngularJS
body: <p>I have multiple date pickers in my form. On default those are closed and once a date is selected, they close again. Also, even if I dont select a date and just click outside of it, it'll close automatically.</p>
  
  <p>However, when I open the first date and do not click outside or choose a certain date and then simply open the second date picker, the first date picker stays open. </p>
  
  <p>How can I avoid that and also make sure, that even when clicking to the second datepicker the first closes automatically?</p>
  
  <pre><code>           &lt;button type="button" id="dateButton" class="btn btn-default" ng-click="open($event,'dt')" &gt;
            &lt;input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt"
                   is-open="datepicker.dt" min-date="minDate" max-date="maxDate" show-weeks="false" ng-required="true"
                   datepicker-options="dateOptions" show-button-bar="false" readonly="readonly"/&gt;
          &lt;/button&gt;
  
          &lt;button type="button" id="dateButton" class="btn btn-default" ng-click="open($event,'dt2')" &gt;
            &lt;input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt2"
                   is-open="datepicker.dt2" min-date="minDate" max-date="maxDate" show-weeks="false" ng-required="true"
                    show-button-bar="false" readonly="readonly"/&gt;
          &lt;/button&gt;
  </code></pre>
  
  <p>_</p>
  
  <pre><code>$scope.datepicker={
    dt:false,
    dt2:false
  };
  $scope.open = function($event,which) {
    $event.preventDefault();
    $event.stopPropagation();
  
    $scope.datepicker[which] = true;
  };
  $scope.format = 'dd-MMM-yyyy';
  </code></pre>
  
  <p>Here is what I did: <a href="http://plnkr.co/edit/o9I3cRej9I7rZUcPpz6O?p=preview" rel="nofollow">plnkr.co/edit/o9I3cRej9I7rZUcPpz6O?p=preview</a> You see if you click one datepicker but then simply click the other one the first one will not close</p>