Add last_updated field to be able to track outdated information / lost items
This commit is contained in:
parent
99df802a40
commit
1bf4eb801f
5 changed files with 22 additions and 2 deletions
|
@ -43,6 +43,9 @@
|
|||
|
||||
<label for="hidden">Hide by default</label>
|
||||
<input type="checkbox" id="hidden">
|
||||
|
||||
<label for="last_updated">Last updated</label>
|
||||
<input id="last_updated" type="text" disabled>
|
||||
</form>
|
||||
|
||||
<button id="delete" class="btn red" autocomplete="off">Delete</button>
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue