Compare commits

...

1 Commits

Author SHA1 Message Date
Iziram
bd15b2f419 Assiduites + EDT : ajout heures liens EDT 2023-11-13 15:20:06 +01:00
3 changed files with 22 additions and 5 deletions

View File

@ -139,7 +139,9 @@ def formsemestre_edt_dict(formsemestre: FormSemestre) -> list[dict]:
scodoc_dept=g.scodoc_dept,
formsemestre_id=formsemestre.id,
moduleimpl_id=modimpl.id,
jour = event.decoded("dtstart").isoformat(),
jour = event.decoded("dtstart").date().isoformat(),
heure_deb = event.decoded("dtstart").isoformat(),
heure_fin = event.decoded("dtend").isoformat(),
group_ids=group.id,
)}">absences</a>
</div>"""

View File

@ -260,6 +260,21 @@
return ((a - b) / (t_end - t_start)) * 100;
}
function fromTime(time, separator = ":") {
// On peut recevoir 2 formats
// "HH:MM" ou "2023-11-15T16:30:00+00:00"
// Si on a le format : "2023-11-15T16:30:00+00:00"
if (time.indexOf("T") != -1) {
// On récupère uniquement le temps
time = new Date(time).toTimeString()
let match = time.match(/(\d\d:){2}(\d\d)/g)
if (match == null) {
throw RangeError(`Invalid Time -> ${time}`)
}
time = match[0]
}
const [hours, minutes] = time.split(separator).map((el) => Number(el))
return hours + minutes / 60
}

View File

@ -263,8 +263,8 @@ def signal_assiduites_etud():
# Récupération de la date (par défaut la date du jour)
date = request.args.get("date", datetime.date.today().isoformat())
heures: list[str] = [
request.args.get("heure_deb", ""),
request.args.get("heure_fin", ""),
request.args.get("heure_deb", "").replace("%2B", "+"),
request.args.get("heure_fin", "").replace("%2B", "+"),
]
# gestion évaluations (Appel à la page depuis les évaluations)
@ -581,8 +581,8 @@ def signal_assiduites_group():
moduleimpl_id: int = request.args.get("moduleimpl_id")
date: str = request.args.get("jour", datetime.date.today().isoformat())
heures: list[str] = [
request.args.get("heure_deb", ""),
request.args.get("heure_fin", ""),
request.args.get("heure_deb", "").replace("%2B", "+"),
request.args.get("heure_fin", "").replace("%2B", "+"),
]
group_ids: list[int] = request.args.get("group_ids", None)
if group_ids is None: