im get date for ng-model like that
Thu May 21 2015 18:47:07 GMT+0700 (SE Asia Standard Time)
but it show me in console "TypeError: date.split is not a function" how to fix it?
$scope.test = function(date) {
console.log(date);
$scope.d = (date.split(' ')[0]);
$scope.m = (date.split(' ')[1]);
$scope.y = (date.split(' ')[2]);
$scope.dd = (date.split(' ')[3]);
}