сделал настройку временных слотов

This commit is contained in:
Zuev
2026-05-01 20:55:49 +03:00
parent bf02efb8b8
commit 3cb311f469
32 changed files with 2130 additions and 383 deletions

View File

@@ -2,13 +2,13 @@ import { api } from '../api.js';
import { escapeHtml, showAlert, hideAlert } from '../utils.js';
const DAY_OPTIONS = [
{ value: 1, label: 'Понедельник' },
{ value: 2, label: 'Вторник' },
{ value: 3, label: 'Среда' },
{ value: 4, label: 'Четверг' },
{ value: 5, label: 'Пятница' },
{ value: 6, label: 'Суббота' },
{ value: 7, label: 'Воскресенье' }
{ value: 1, label: 'Понедельник', shortLabel: 'Пн' },
{ value: 2, label: 'Вторник', shortLabel: 'Вт' },
{ value: 3, label: 'Среда', shortLabel: 'Ср' },
{ value: 4, label: 'Четверг', shortLabel: 'Чт' },
{ value: 5, label: 'Пятница', shortLabel: 'Пт' },
{ value: 6, label: 'Суббота', shortLabel: 'Сб' },
{ value: 7, label: 'Воскресенье', shortLabel: 'Вс' }
];
const SEMESTER_LABELS = {
@@ -548,7 +548,7 @@ export async function initAcademicCalendar() {
<tbody>
${DAY_OPTIONS.map(day => `
<tr>
<th class="calendar-day-head">${escapeHtml(day.label.slice(0, 2))}</th>
<th class="calendar-day-head">${escapeHtml(day.shortLabel)}</th>
${weeks.map(week => {
const row = cellByWeekAndDay.get(`${week}:${day.value}`);
return row ? renderCalendarDay(row) : '<td class="calendar-empty-day"></td>';
@@ -804,8 +804,7 @@ export async function initAcademicCalendar() {
}
function shortDayLabel(value) {
const label = dayLabel(value);
return label === '-' ? '-' : label.slice(0, 2);
return DAY_OPTIONS.find(day => String(day.value) === String(value))?.shortLabel || '-';
}
function formatShortDate(value) {