From 8dc3806a27c629c41852614aab08a0d4ce76f6f6 Mon Sep 17 00:00:00 2001 From: Iziram Date: Tue, 26 Sep 2023 11:39:12 +0200 Subject: [PATCH] Assiduites : bug bouton journee page ajout justi --- app/templates/assiduites/pages/ajout_justificatif.j2 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/templates/assiduites/pages/ajout_justificatif.j2 b/app/templates/assiduites/pages/ajout_justificatif.j2 index 28c4b6159..c4885b3f8 100644 --- a/app/templates/assiduites/pages/ajout_justificatif.j2 +++ b/app/templates/assiduites/pages/ajout_justificatif.j2 @@ -219,20 +219,27 @@ } function dayOnly() { + const { deb, fin } = getDates(); if (document.getElementById('justi_journee').checked) { document.getElementById("justi_date_debut").type = "date" + document.getElementById("justi_date_debut").value = deb.slice(0, deb.indexOf('T')) + document.getElementById("justi_date_fin").type = "date" + document.getElementById("justi_date_fin").value = fin.slice(0, fin.indexOf('T')) } else { document.getElementById("justi_date_debut").type = "datetime-local" + document.getElementById("justi_date_debut").value = `${deb}T${assi_morning}` + document.getElementById("justi_date_fin").type = "datetime-local" + document.getElementById("justi_date_fin").value = `${fin}T${assi_evening}` } } function getDates() { if (document.querySelector('.page #justi_journee').checked) { const date_str_deb = document.querySelector(".page #justi_date_debut").value - const date_str_fin = document.querySelector(".page #justi_date_debut").value + const date_str_fin = document.querySelector(".page #justi_date_fin").value