1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
if (JSON.parse(body).items[i].priority == '1') {icontodo ='P1 - '}
else if (JSON.parse(body).items[i].priority == '2') {icontodo ='P2 - '}
else if (JSON.parse(body).items[i].priority == '3') {icontodo ='P3 - '}
else {icontodo ='P4 - '};
if (JSON.parse(body).items[i].due_date_utc)
{
date1 = new Date();
date2 = new Date(JSON.parse(body).items[i].due_date_utc);
diff = dateDiff(date1, date2);
if(diff.day > 0)
{
dayretour = diff.day + "d ";
}
else
{
dayretour = '';
};
if(diff.hour > 0)
{
hourretour = diff.hour + "h";
}
else
{
hourretour = '';
};
if(diff.hour > 0)
{
minretour = diff.min + "min";
}
else
{
minretour = '';
};
if (!dayretour && !hourretour && !minretour) {datedueretour ='TIME IS UP - ';}
else {datedueretour += dayretour + hourretour + minretour + " - ";};
}
else {datedueretour =''};
contentretour = JSON.parse(body).items[i].content;
if (JSON.parse(body).items[i].responsible_uid ) {
if (JSON.parse(body).items[i].responsible_uid == '102xxxx') {
assignedtodoname ='T - '
}
else if (JSON.parse(body).items[i].responsible_uid == '102xxxx') {assignedtodoname ='N - '}
else {assignedtodoname ='Inconnu'};
} else { assignedtodoname ='' };
//checkedretour = JSON.parse(body).items[i].checked;
onbalance +=assignedtodoname + icontodo + datedueretour + contentretour;
items.push(onbalance); |
Partager