From d39dddf60db727a828d320c046f440c967c82042 Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 20 Nov 2023 23:39:23 +0100 Subject: [PATCH] default date --- web/js/addItem.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/js/addItem.js b/web/js/addItem.js index cbbbcbd..fec3e43 100644 --- a/web/js/addItem.js +++ b/web/js/addItem.js @@ -3,6 +3,11 @@ signOut(); closeButton(); pathURL = document.location.pathname.split("/")[document.location.pathname.split("/").length-1].split(".")[0].replace("add","") +if (pathURL == "event"){ + lastdate = new Date(); + document.getElementById("start_dateUpdateInput").value=lastdate.getFullYear()+"-"+lastdate.getMonth()+"-"+lastdate.getDate()+"T00:00"; + document.getElementById("end_dateUpdateInput").value=lastdate.getFullYear()+"-"+lastdate.getMonth()+"-"+lastdate.getDate()+"T06:00"; +} document.getElementById("addUser").addEventListener("click", function(){ switch (pathURL){ @@ -11,6 +16,7 @@ document.getElementById("addUser").addEventListener("click", function(){ break; case "event": var updateProfil = ["name", "place", "start_date", "end_date"]; + break; default: var updateProfil = []