I have a datepicker on my angularJS WCFrest project
i get the data using
<div class="col-md-4">
<input id="txtOldDate" type="date" class="datepicker" ng-model="oldDate" />
</div>
but the data that acquired is too complex when i get the data
Fri Dec 16 2016 00:00:00 GMT+07 (SE Asia Standard Time)
i just want to get the value like on the date picker interface
12/16/2016
this is my controller.js
$scope.SearchApproval = function(employeeID, oldDate, newDate, departemen, approver) {
var promiseGet = GetApproval.GetApprovalData($scope.employeeID, $scope.oldDate, $scope.newDate, $scope.departemen, $scope.approver);
//GetApprovalData();
promiseGet.then(function(pl) {
$scope.GetApprovalData = pl.data
},
function(errorPl) {
console.log('Some Error in Getting Records.', errorPl);
});
}
is there any way to format the result?
i already try $filter
$scope.oldDate = $filter('date')(new Date(dateString), 'yyyy-MM-dd');
but it give me this error
Error: [ngModel:datefmt] Expected
2016-12-20to be a date

http://localhost:51458/ServiceRequest.svc/GetApproval?employeeID=22134&oldDate=Fri%20Dec%2009%202016%2000:00:00%20GMT+0700%20(SE%20Asia%20Standard%20Time)http://localhost:51458/ServiceRequest.svc/GetApproval?employeeID=&oldDate=2016-12-20)@madalinivascu is there any way to convert the result before i send it to uri?