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); return !nonWorkdays.includes(d);
} }
function retourJourTravail(date) { function retourJourTravail(date, anti = true) {
const jourMiliSecondes = 86400000; // 24 * 3600 * 1000 | H * s * ms const jourMiliSecondes = 86400000; // 24 * 3600 * 1000 | H * s * ms
let jour = date; let jour = date;
let compte = 0; let compte = 0;
while (!estJourTravail(jour, nonWorkDays) && compte++ < 7) { 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; return jour;
} }
@ -837,6 +840,17 @@ function dateCouranteEstTravaillee() {
return true; 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 * Ajout de la visualisation des assiduités de la mini timeline
* @param {HTMLElement} el l'élément survollé * @param {HTMLElement} el l'élément survollé

View File

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