I've got a Calendar. Inside its code there's an Object and a JSON to it, which contains several properties such as
[{"Date":"17-3-2015","Event":"Test drive","Participants":"John, George","Description":"Testing a new F30"},
{"Date":"17-3-2015","Event":"Football match","Participants":"FCSM vs FCKK","Description":"New season start"},
{"Date":"25-3-2015","Event":"Jane's Birthday","Participants":"Jane, John, Richard, Alice","Description":"Celebration with my friends"}]
But since that data is in localStorage I retrieved it via
var existEvents = JSON.parse(localStorage.getItem('events'));
for(i=0; i<existEvents.length; i++) {
var item = localStorage.getItem(localStorage.key(i));
console.log(item);
};
existEvents
= every new event in my Calendar
console.log(item);
returns me the data typed above.
What I need is to retrieve every Date value (= key). So I pretend that
item.Date
must work, but it doesn't. As well as
item[0].value
I tried it after having read this question + answers Access / process (nested) objects, arrays or JSON
What am I doing wrong? Please, help!