mirror of
https://framagit.org/framasoft/framadate/funky-framadate-front.git
synced 2023-08-25 13:53:14 +02:00
affiche le récapitulatif en fonction des dates qui ont été saisies
This commit is contained in:
parent
9c27b43d3b
commit
f6ded6f5fa
@ -45,12 +45,12 @@
|
||||
</li>
|
||||
<li>
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
<input type="date" name="date-1">
|
||||
<input type="date" name="date-2">
|
||||
<button class="remove btn-no-style"><i class="fas fa-trash-alt"></i></button>
|
||||
<ul class="horaire-different" style="display:none">
|
||||
<li>
|
||||
<i class="far fa-chrono-alt"></i>
|
||||
<input type="text" name="horaire-1">
|
||||
<input type="text" name="horaire-2">
|
||||
<button class="remove btn-no-style"><i class="fas fa-trash-alt"></i></button>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -17,35 +17,9 @@
|
||||
|
||||
<body>
|
||||
|
||||
<section>
|
||||
<section id="recapitulatif">
|
||||
<h1>Récapitulatif</h1>
|
||||
|
||||
<article>
|
||||
<span class="bold">Jeudi 17 août 2018</span>
|
||||
<ul class="default-list">
|
||||
<li> 8:00 </li>
|
||||
<li> 9:00 </li>
|
||||
<li> 10:00 </li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
<article>
|
||||
<span class="bold">Jeudi 05 avril 2018</span>
|
||||
<ul class="default-list">
|
||||
<li> 8:00 </li>
|
||||
<li> 9:00 </li>
|
||||
<li> 10:00 </li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
<article>
|
||||
<span class="bold">Dimanche 31 avril 2018</span>
|
||||
<ul class="default-list">
|
||||
<li> 15:00 </li>
|
||||
</ul>
|
||||
</article>
|
||||
|
||||
|
||||
</section>
|
||||
|
||||
<nav>
|
||||
@ -56,4 +30,4 @@
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
@ -170,5 +170,32 @@ const initEventOnScreen = () => {
|
||||
addInputToStorageEvent();
|
||||
}
|
||||
|
||||
if($('#recapitulatif')) {
|
||||
|
||||
var tableauDeDates = []
|
||||
|
||||
for(var i = 0; i < localStorage.length; i++) {
|
||||
let key = localStorage.key(i)
|
||||
let splittedKey = key.split('-')
|
||||
if(splittedKey[0] == 'date') {
|
||||
|
||||
tableauDeDates.push(new Date(localStorage[key]))
|
||||
}
|
||||
}
|
||||
tableauDeDates.sort().reverse().forEach( (date) => {
|
||||
var spanDate = document.createElement("span")
|
||||
spanDate.className = "bold"
|
||||
let jours = ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"]
|
||||
let mois = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"]
|
||||
let dateEnTexte = `${jours[date.getDay()]} ${date.getDate()} ${mois[(date.getMonth())]} ${date.getFullYear()}`
|
||||
spanDate.appendChild(document.createTextNode(dateEnTexte))
|
||||
|
||||
var article = document.createElement("article")
|
||||
article.appendChild(spanDate)
|
||||
|
||||
$('#recapitulatif').appendChild(article)
|
||||
})
|
||||
}
|
||||
|
||||
initEventOnScreen();
|
||||
debugStorage();
|
||||
|
Loading…
Reference in New Issue
Block a user