From c811b4eb4e5d774eb5ccd5bceb237419105bd5d3 Mon Sep 17 00:00:00 2001 From: scossa Date: Thu, 22 Aug 2024 18:26:33 +0200 Subject: [PATCH] fix_temp_mrk_date --- public/js/eventHandler.js | 3 ++- public/js/markerHandler.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/public/js/eventHandler.js b/public/js/eventHandler.js index 9c48c99..f77cc21 100644 --- a/public/js/eventHandler.js +++ b/public/js/eventHandler.js @@ -61,12 +61,13 @@ export function initEvents(map) { noticeCoordsPicker.style.display = 'none'; remainingForm.style.display = 'block'; map.getContainer().style.cursor = 'auto'; + const formattedDate = new Date().toISOString(); const tmpMarker = { coordinate: { x: formInputCoordX.value, y: formInputCoordY.value }, name: "", description: "Compila il form per aggiungere un marker qui. Oppure annulla l'inserimento del marker cliccando sulla X in alto a destra", filename: "../img/trashw.png", - ts: Date.now().toString(), + ts: formattedDate, } tmpMarkerSet = createMarker(tmpMarker, L, map, true) isTmpMarkerSet = true diff --git a/public/js/markerHandler.js b/public/js/markerHandler.js index 8482fbe..b0bf5eb 100644 --- a/public/js/markerHandler.js +++ b/public/js/markerHandler.js @@ -15,8 +15,9 @@ export function createMarker(markerData, L, map, returnMarker = false){ let popUpContentTitle = "

"+ markerData.name +"

"; let popUpContentdescription = "

"+ markerData.description +"

"; let popUpContentImage = ""; - let popUpContentDate = "

Inserito il: " + markerData.ts.substring(0, 10) + "
alle " + markerData.ts.substring(11, 16) + "

"; - let popUpContent = popUpContentTitle + popUpContentdescription + popUpContentImage + popUpContentDate + let popUpContentDate = "

Inserito il: " + markerData.ts.substring(0, 10) + "
alle: " + markerData.ts.substring(11, 16) + "

"; + //let popUpContentHour = "

" + "alle: " + markerData.ts.substring(11, 16) + "

"; + let popUpContent = popUpContentTitle + popUpContentdescription + popUpContentImage + popUpContentDate //+ popUpContentHour marker.bindPopup(popUpContent); if(returnMarker) { return marker;