1
0
forked from ScoDoc/ScoDoc
This commit is contained in:
Emmanuel Viennet 2023-09-18 17:44:10 +02:00
commit e2891e37cd

View File

@ -19,7 +19,7 @@
<div class="justi-label"> <div class="justi-label">
<legend for="justi_date_debut" required>Date de début</legend> <legend for="justi_date_debut" required>Date de début</legend>
<input type="datetime-local" name="justi_date_debut" id="justi_date_debut"> <input type="datetime-local" name="justi_date_debut" id="justi_date_debut">
<span>Journée entière</span> <input type="checkbox" name="justi_journee" id="justi_journee"> <span>Journée(s) entière(s)</span> <input type="checkbox" name="justi_journee" id="justi_journee">
</div> </div>
<div class="justi-label" id="date_fin"> <div class="justi-label" id="date_fin">
<legend for="justi_date_fin" required>Date de fin</legend> <legend for="justi_date_fin" required>Date de fin</legend>
@ -221,21 +221,22 @@
function dayOnly() { function dayOnly() {
if (document.getElementById('justi_journee').checked) { if (document.getElementById('justi_journee').checked) {
document.getElementById("date_fin").style.display = "none";
document.getElementById("justi_date_debut").type = "date" document.getElementById("justi_date_debut").type = "date"
document.getElementById("justi_date_fin").type = "date"
} else { } else {
document.getElementById("date_fin").style.display = "block";
document.getElementById("justi_date_debut").type = "datetime-local" document.getElementById("justi_date_debut").type = "datetime-local"
document.getElementById("justi_date_fin").type = "datetime-local"
} }
} }
function getDates() { function getDates() {
if (document.getElementById('justi_journee').checked) { if (document.getElementById('justi_journee').checked) {
const date_str = document.getElementById("justi_date_debut").value const date_str_deb = document.getElementById("justi_date_debut").value
const date_str_fin = document.getElementById("justi_date_debut").value
return { return {
"deb": `${date_str}T${assi_morning}`, "deb": `${date_str_deb}T${assi_morning}`,
"fin": `${date_str}T${assi_evening}`, "fin": `${date_str_fin}T${assi_evening}`,
} }
} }