Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
2 changed files with 22 additions and 2 deletions
Showing only changes of commit 1cec3fa703 - Show all commits

View File

@ -798,13 +798,16 @@ function estJourTravail(jour, nonWorkdays) {
return !nonWorkdays.includes(d);
}
function retourJourTravail(date) {
function retourJourTravail(date, anti = true) {
const jourMiliSecondes = 86400000; // 24 * 3600 * 1000 | H * s * ms
let jour = date;
let compte = 0;
while (!estJourTravail(jour, nonWorkDays) && compte++ < 7) {
jour = new Date(jour - jourMiliSecondes);
let temps = anti
? jour - jourMiliSecondes
: jour.valueOf() + jourMiliSecondes;
jour = new Date(temps);
}
return jour;
}
@ -837,6 +840,17 @@ function dateCouranteEstTravaillee() {
return true;
}
function jourSuivant(anti = false) {
let date = $("#date").datepicker("getDate");
date = anti ? date.add(-1, "days") : date.add(1, "days");
const nouvelleDate = retourJourTravail(date, anti);
$("#date").datepicker("setDate", nouvelleDate);
creerTousLesEtudiants(etuds);
}
/**
* Ajout de la visualisation des assiduités de la mini timeline
* @param {HTMLElement} el l'élément survollé

View File

@ -153,8 +153,14 @@
<div class="infos">
<div class="infos-button">Groupes&nbsp;: {{grp|safe}}</div>
<div>
<button class="btn_date" onclick="jourSuivant(true)">
&LeftArrowBar;
</button>
<input type="text" name="date" id="date" class="datepicker" value="{{date}}">
</div>
<button class="btn_date" onclick="jourSuivant(false)">
&RightArrowBar;
</button>
</div>
</fieldset>
<div style="display: {{'none' if readonly == 'true' else 'block'}};">