1
0

fix: Exkurze shit
All checks were successful
Remote Deploy / deploy (push) Successful in 5s

This commit is contained in:
2026-02-09 19:26:55 +01:00
parent 75d8ba745f
commit cfdd97c935
2 changed files with 31 additions and 0 deletions

View File

@@ -116,6 +116,28 @@ export default function parseAbsence(input, teacherMap = {}) {
markConsumed(matchStart, matchEnd);
}
// 1a. Teachers with "-startHour-exk" suffix (e.g. "Sv-5-exk")
const teacherStartExkRe = /([A-Za-z]+)-(\d+)-exk/gi;
while ((m = teacherStartExkRe.exec(s)) !== null) {
const matchStart = m.index;
const matchEnd = teacherStartExkRe.lastIndex;
if (isConsumed(matchStart)) continue;
const teacherCode = m[1];
const from = Number(m[2]);
const { name } = resolveTeacher(teacherCode, teacherMap);
if (from >= 1 && from <= LAST_HOUR) {
results.push({
teacher: name,
teacherCode: teacherCode.toLowerCase(),
type: "exkurze",
hours: { from, to: LAST_HOUR },
});
markConsumed(matchStart, matchEnd);
}
}
// 2. Teachers with "-exk" suffix
const teacherExkRe = /([A-Za-z]+)-exk/gi;
while ((m = teacherExkRe.exec(s)) !== null) {