Angular.js <input type="date"> ändern Sie das format der übermittelten Wert

<label>From</label>
<input type="date"  ng-model="startDate"/>
<label>To</label>
<input type="date" ng-model="endDate"/>

<button class="btn btn-success" ng-click="getStatistics(startDate, endDate)">Update</button>

**JS***

$scope.getStatistics = function(startDate, endDate) {
    $http.get('/admin/api/stats?start=' + startDate + '&end=' + endDate).success(function(data) {
        $scope.stats = data;
    });
}

Den code oben schieben startDate und endDate Wert auf die url, aber das problem das ich habe ist, dass die übermittelten Wert ist wie 2014-12-01-und ich will, dass mein format 01-05-2014

Irgendwelche Vorschläge?

InformationsquelleAutor user3531335 | 2014-04-16
Schreibe einen Kommentar