I have a datetime coming from the database that looks like: 2014-10-09 14:14:27
I am pulling it with angular and trying to format it in a way that I can work with. This is what I currently have:
$http.get('/ajax/get-feedings.php')
.success(function(data) {
$scope.listing = [];
for (var i = 0; i < data.length; i += 1) {
$scope.listing.push({
date: new Date(data[i].date),
feeding: data[i].feeding
});
}
})
But javascript is saying that the date is invalid? I have no idea what is going on.
This is the json that is coming in if that helps
[
{
"date":"2014-10-09 14:14:27",
"feeding":[
{
"id":"13",
"amount":"0"
}
]
}
]