include the after-break

This commit is contained in:
Mylloon 2022-08-16 14:50:22 +02:00
parent 8cb99e69af
commit 732f56f0be
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -242,10 +242,13 @@ pub fn build(timetable: T, dates: D) -> Vec<models::Course> {
let mut semester = Vec::new();
// Start date of the back-to-school week
let data = dates.get(&timetable.1 .0).unwrap().get(0).unwrap();
let mut date = data.0;
let break_data = dates.get(&timetable.1 .0).unwrap();
let before_break = break_data.get(0).unwrap();
let mut date = before_break.0;
let mut rep = before_break.1;
// For each weeks
for _ in 0..(data.1) {
for _ in 0..2 {
for _ in 0..rep {
for day in &timetable.1 .1 {
for mut course in day.courses.clone().into_iter().flatten() {
// Get the hours
@ -270,6 +273,10 @@ pub fn build(timetable: T, dates: D) -> Vec<models::Course> {
// From friday to monday
date += Duration::days(2);
}
let after_break = break_data.get(1).unwrap();
date = after_break.0;
rep = after_break.1;
}
semester
}