Add last_updated field to be able to track outdated information / lost items

This commit is contained in:
clonejo 2024-01-14 20:23:08 +01:00
parent 99df802a40
commit 1bf4eb801f
5 changed files with 22 additions and 2 deletions

View file

@ -39,6 +39,7 @@ function fillForm() {
document.getElementById('content').value = item.content;
document.getElementById('note').value = item.note;
document.getElementById('hidden').checked = item.hidden;
document.getElementById('last_updated').value = formatTimestamp(item.last_updated);
formCoordsToMap();
}
@ -172,3 +173,8 @@ function formCoordsToMap() {
coordsToMap(coords_bl, coords_tr);
}
}
function formatTimestamp(ts) {
const date = new Date(ts * 1000);
return date.toLocaleDateString();
}