AngularJS UI-Bootstrap-Datepicker-Datum-Format im Controller ist nicht korrekt

Ich bin mit einem datepicker in meine html-Seite wie folgt:

HTML

  <div ng-controller="StartDateCtrl">
    <label class="control-label" for="startDate">  Date:</label>   
    <div class="row">
        <div class="col-md-6">
            <p class="input-group">
              <input type="text"  name="startDate" class="form-control" show-button-bar="true" datepicker-popup="yyyy-MM-dd" ng-model="startDate" is-open="opened" min="minDate" max="'22-06-2015'" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" />
              <span class="input-group-btn">
                <button class="btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
              </span>
            </p>
        </div>
    </div>
    </div> 

DATUM-PICKER-CONTROLLER

var StartDateCtrl= function ($scope) {
  $scope.today = function() {
    $scope.travelStartDate = new Date();
  };
  $scope.today();

  $scope.showWeeks = true;
  $scope.toggleWeeks = function () {
    $scope.showWeeks = ! $scope.showWeeks;
  };

  $scope.clear = function () {
    $scope.travelStartDate = null;
  };

  //Disable weekend selection
  $scope.disabled = function(date, mode) {
    return ( mode === 'day' && ( date.getDay() === 0 || date.getDay() === 6 ) );
  };

  $scope.toggleMin = function() {
    $scope.minDate = ( $scope.minDate ) ? null : new Date();
  };
  $scope.toggleMin();

  $scope.open = function($event) {
    $event.preventDefault();
    $event.stopPropagation();

    $scope.opened = true;
  };

  $scope.dateOptions = {
    'year-format': "'yy'",
    'starting-day': 1
  };

  //$scope.formats = ['dd-MMMM-yyyy', 'yyyy/MM/dd', 'shortDate'];
  $scope.formats = ['yyyy-MM-dd'];
  $scope.format = $scope.formats[0];
};

HAUPT-CONTROLLER

app.controller('UpdateShoppingBasketCtrl', ['$scope', 'ShoppingBasketFactory', '$location',
                                  function ($scope, ShoppingBasketFactory, $location) {


        alert('START DATE = '+ $scope.startDate );
}]);

Wenn die web-Seite vorlegen, ich bin retriving das Datum im Hauptformular controller aber das format ist Verschieden von dem, was angezeigt wird in meinem date-picker popup.
Das format angezeigt, nach der Auswahl ist zum Beispiel '26/03/2014'.
Aber in meinem controller habe ich bekommen :
Thu 26 Mar 2014 00:00:00 GMT 0000 (GMT Standard Time)

Bitte, Wie bekomme ich das angezeigt Datum-format in den controller und NICHT die "Thu 26 Mar 2014 00:00:00 GMT 0000 (GMT Standard Time)"????

InformationsquelleAutor olatom | 2014-03-26

Schreibe einen Kommentar