fix(schedule): hide empty days and lessons, update design and fonts
This commit is contained in:
@@ -525,6 +525,9 @@ function parseTeacherSchedule(
|
||||
subject: subject || groupShort || group || roomText,
|
||||
}
|
||||
|
||||
// Если нет предмета и группы, это пустая пара
|
||||
if (!subject && !groupShort && !group) continue
|
||||
|
||||
if (location || roomText) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error — расширяем union тип за счет наличия place
|
||||
@@ -545,6 +548,9 @@ function parseTeacherSchedule(
|
||||
})
|
||||
}
|
||||
|
||||
// Фильтруем пустые дни для преподавателей
|
||||
const filteredDays = days.filter(day => day.lessons.length > 0)
|
||||
|
||||
// Извлекаем wk из URL
|
||||
const currentUrl = url || document.location?.href || ''
|
||||
const wkMatch = currentUrl.match(/[?&]wk=(\d+)/)
|
||||
@@ -570,7 +576,7 @@ function parseTeacherSchedule(
|
||||
}
|
||||
|
||||
return {
|
||||
days,
|
||||
days: filteredDays,
|
||||
currentWk,
|
||||
availableWeeks,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user