title: AngularJS Bootstrap UI datepicker issues
body: <p>My datepicker is not working properly.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;div datepicker-config class="datepicker input-group"&gt;
      {{ dateOffer }}
      &lt;input type="text" class="form-control" datepicker-popup="{{ format }}" name="dateOffer" ng-model="dateOffer" is-open="opened" min-date="minDate" datepicker-options="dateOptions" ng-required="true" ng-readonly="true" /&gt;
      &lt;span class="input-group-btn"&gt;
          &lt;button type="button" class="btn btn-default" ng-click="open($event)" tabindex="-1"&gt;&lt;i class="glyphicon glyphicon-calendar"&gt;&lt;/i&gt;&lt;/button&gt;
      &lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If I am setting date by selecting it, I am getting proper value in input box</p>
  
  <pre><code>20.07.2015 (this is dd.mm.yyyy)
  </code></pre>
  
  <p>By looking at expression {{ dateOffer }} I am seeing </p>
  
  <pre><code>"2015-07-20T12:54:43.898Z" 
  </code></pre>
  
  <p>which is okay too.</p>
  
  <p>But when I am posting data and seeing it by <code>console.log($scope.dateOffer)</code>, the value is </p>
  
  <pre><code>Tue Jul 28 2015 14:54:43 GMT+0200 (CEST) 
  </code></pre>
  
  <p>which is odd. Have in mind that when loading page I am setting <code>$scope.dateOffer = new Date();</code></p>
  
  <p>CONTROLLER</p>
  
  <pre><code>$scope.dateOffer = new Date();
  </code></pre>
  
  <p>CONFIG</p>
  
  <pre><code>angular
      .module('offerCreateUpdate')
      .directive('datepickerConfig', function() {
          return {
              restrict: 'A',
              scope: true,
              controller: function($scope, datepickerPopupConfig) {
                  datepickerPopupConfig.closeText = 'Some text';
                  datepickerPopupConfig.clearText = 'Some text';
                  datepickerPopupConfig.currentText = 'Some text';
                  datepickerPopupConfig.datepickerPopup = 'dd.MM.yyyy';
  
                  $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));
                  };
  
                  var today = new Date();
                  $scope.minDate = today.setDate(today.getDate() - 30);
  
                  $scope.open = function($event) {
                      $event.preventDefault();
                      $event.stopPropagation();
  
                      $scope.opened = true;
                  };
  
                  $scope.dateOptions = {
                      startingDay: 1,
                      showWeeks: false
                  };
  
                  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>