Split substitution if it is longer than 1 lesson

This commit is contained in:
2022-05-02 23:44:23 +02:00
parent b3f2ec52d4
commit e36c90786a
2 changed files with 11 additions and 2 deletions

View File

@ -58,7 +58,12 @@ export function parseSubstitutionPlan(html) {
rowData[columntitle] = cleantext;
});
data.push(rowData);
const rawLesson = rowData.lesson;
const lessons = rawLesson.match(/\d+/g).map(Number);
for (const lesson of lessons) {
rowData.lesson = lesson;
data.push(rowData);
}
});
infos.changes = data;