I would like to tell a json object, to stringify the object that belongs to the array with this days date/time.
I have a php script which fetches a json object, with multiple arrays in it, which looks something like this:
data: Array(55)
0: {date: "2017112700", p: Array(1)}
1: {date: "2017112701", p: Array(1)}
2: {date: "2017112702", p: Array(1)}
and so forth...55 in all.
I am able to verify that my date variable (date_test) matches a date variable in the json array.
var date_test;
var index = json.data.findIndex(function(item, i){
return item.date === date_test
});
console.log(index);
Lets say that console.log(index); gives my a '9'.
This shows me where date_test and item.date match.
Now this where I am stuck....I can stringify and whatever the information from the json arrays, but I would like stringify the object that matches my date_test. Anyone?