сделал настройку временных слотов
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user