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
4 changed files with 10 additions and 10 deletions
Showing only changes of commit a7935d375a - Show all commits

View File

@ -300,7 +300,7 @@ def _load_and_convert_ics(formsemestre: FormSemestre) -> list[dict]:
.replace(tzinfo=timezone.utc) .replace(tzinfo=timezone.utc)
.astimezone(tz=None) .astimezone(tz=None)
.strftime("%H:%M"), .strftime("%H:%M"),
"jour": event.decoded("dtstart").isoformat(), "jour": event.decoded("dtstart").date().isoformat(),
"start": event.decoded("dtstart").isoformat(), "start": event.decoded("dtstart").isoformat(),
"end": event.decoded("dtend").isoformat(), "end": event.decoded("dtend").isoformat(),
} }

View File

@ -611,7 +611,7 @@ function updateDate() {
} }
let dateStr = ""; let dateStr = "";
if (!verifyNonWorkDays(date.getDay(), nonWorkDays)) { if (!isNonWorkDay(date.getDay(), nonWorkDays)) {
dateStr = formatDate(date).capitalize(); dateStr = formatDate(date).capitalize();
} else { } else {
// On se rend au dernier jour travaillé disponible // On se rend au dernier jour travaillé disponible
@ -645,7 +645,7 @@ function getNearestWorkDay(date) {
const aDay = 86400000; // 24 * 3600 * 1000 | H * s * ms const aDay = 86400000; // 24 * 3600 * 1000 | H * s * ms
let day = date; let day = date;
let count = 0; let count = 0;
while (verifyNonWorkDays(day.getDay(), nonWorkDays) && count++ < 7) { while (isNonWorkDay(day.getDay(), nonWorkDays) && count++ < 7) {
day = new Date(day - aDay); day = new Date(day - aDay);
} }
return day; return day;
@ -702,7 +702,7 @@ function formatDateModal(str, separator = " ") {
* Vérifie si la date sélectionnée n'est pas un jour non travaillé * Vérifie si la date sélectionnée n'est pas un jour non travaillé
* Renvoie Vrai si le jour est non travaillé * Renvoie Vrai si le jour est non travaillé
*/ */
function verifyNonWorkDays(day, nonWorkdays) { function isNonWorkDay(day, nonWorkdays) {
let d = ""; let d = "";
switch (day) { switch (day) {
case 0: case 0:

View File

@ -43,7 +43,7 @@
d = new Date(dateString).getDay(); d = new Date(dateString).getDay();
if (verifyNonWorkDays(d, nonWorkDays)) return; if (isNonWorkDay(d, nonWorkDays)) return;
matin = `${dateString}T${timeMorning}`; matin = `${dateString}T${timeMorning}`;
midi = `${dateString}T${timeNoon}`; midi = `${dateString}T${timeNoon}`;