|
|
@ -46,13 +46,21 @@ async function displayTodos(showDone) { |
|
|
|
|
|
|
|
|
|
|
|
// Display |
|
|
|
// Display |
|
|
|
let timeCreated = new Date(item.timeCreatedUnix * 1000); |
|
|
|
let timeCreated = new Date(item.timeCreatedUnix * 1000); |
|
|
|
|
|
|
|
if (item.completionTimeUnix != 0) { |
|
|
|
let timeDone = new Date(item.completionTimeUnix * 1000); |
|
|
|
let timeDone = new Date(item.completionTimeUnix * 1000); |
|
|
|
|
|
|
|
|
|
|
|
todosDiv.innerHTML += "<tr><td>" + item.text + "</td>" + |
|
|
|
todosDiv.innerHTML += "<tr><td>" + item.text + "</td>" + |
|
|
|
"<td>" + " " + timeCreated.getDate() + "/" + (timeCreated.getMonth() + 1) + "/" + timeCreated.getFullYear() + " | " + |
|
|
|
"<td>" + " " + timeCreated.getDate() + "/" + (timeCreated.getMonth() + 1) + "/" + timeCreated.getFullYear() + "</td>" + |
|
|
|
timeDone.getDate() + "/" + (timeDone.getMonth() + 1) + "/" + timeDone.getFullYear() + "</td>" + |
|
|
|
"<td>" + " " + timeDone.getDate() + "/" + (timeDone.getMonth() + 1) + "/" + timeDone.getFullYear() + "</td>" + |
|
|
|
"<td>" + "<button class='btn btn-danger' id='" + |
|
|
|
"<td>" + "<button class='btn btn-danger' id='" + |
|
|
|
todoDeleteBtnID + "'><img src='/static/images/trash3-fill.svg'></button></td></tr>"; |
|
|
|
todoDeleteBtnID + "'><img src='/static/images/trash3-fill.svg'></button></td></tr>"; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
todosDiv.innerHTML += "<tr><td>" + item.text + "</td>" + |
|
|
|
|
|
|
|
"<td>" + " " + timeCreated.getDate() + "/" + (timeCreated.getMonth() + 1) + "/" + timeCreated.getFullYear() + "</td>" + |
|
|
|
|
|
|
|
"<td></td>" + |
|
|
|
|
|
|
|
"<td>" + "<button class='btn btn-danger' id='" + |
|
|
|
|
|
|
|
todoDeleteBtnID + "'><img src='/static/images/trash3-fill.svg'></button></td></tr>"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
todosDisplayed.push({item: item, buttonDel: todoDeleteBtnID}); |
|
|
|
todosDisplayed.push({item: item, buttonDel: todoDeleteBtnID}); |
|
|
|