Upon receiving data from an Angular service, I have a JSON object structured like this:
[
{
"id": 2,
"order_status": "R",
"order_date": "2015-09-12T07:58:24.733834Z",
"update_timestamp": "2015-10-05T04:22:44.904227Z"
},
{
"id": 8,
"order_status": "D",
"order_date": "2015-09-18T03:46:50.469051Z",
"update_timestamp": "2015-09-23T19:19:31.658001Z"
}
]
Storing this data in the variable $scope.order_items
, I then proceed to filter it based on the order_status
column:
$scope.order_items = data;
$scope.received = ($scope.order_items.filter(function(item) { return (item.order_status == 'R');}));
$scope.delivered = ($scope.order_items.filter(function(item) { return (item.order_status == 'D');}));
My current goal is to further filter the data by the order_date
column to isolate all entries made today into a separate variable. How can I achieve this?