JSON callback returns me formatted dates and only it. Basing on given dates I have to build a tree structure, which will seperate different years, months and days. Oonly dates which are obtained in the callback are included in the tree.
I've write something like below on ServiceSucceedCallBack:
var daty = '';
var roczniki = '';
var miesiace = '';
var dni = '';
for (var i in result.Content) {
roczniki += '<ol id="lata">' + result.Content[i].getFullYear() + '</ol>';
miesiace += '<ol id="miesiace"><li>' + (result.Content[i].getMonth() + 1) + '</li></ol>';
dni += '<ol id="dni"><li>' + result.Content[i].getDate() + '</li></ol>';
}
var $st = $('#toolLeft');
$st.append(roczniki);
$('#lata').append(miesiace);
$('#miesiace').append(dni);
It gaves a tree view, but every date is written to the first node (first found year) and second problem is that I have no idea how to ommit duplication of datas. I mean, if some year has a place in the tree, than another date with the same year should go to the same node level, no create new one....