diff --git a/src/front/src/components/calendar_of_events/UI_calendar/CustomCalendar.vue b/src/front/src/components/calendar_of_events/UI_calendar/CustomCalendar.vue index a93eb8e61..e6958b38b 100644 --- a/src/front/src/components/calendar_of_events/UI_calendar/CustomCalendar.vue +++ b/src/front/src/components/calendar_of_events/UI_calendar/CustomCalendar.vue @@ -139,7 +139,6 @@ export default { dayCellDidMount: (arg) => { const date = arg.date; const dayInfo = calendarStore.isNonWorkingDay(date); - console.log(dayInfo); if (dayInfo.isHoliday === true) { arg.el.classList.add('non-working-day'); @@ -258,6 +257,12 @@ export default { const handleCalendarDateClick = (info) => { calendarStore.setSelectedDateFromCalendar(info); currentTitle.value = info.view.title; + + const calendarApi = calendarRef.value.getApi(); + // Переходим к выбранной дате в дневном виде + calendarApi.gotoDate(info.date); + calendarApi.changeView('listWeek'); + currentView.value = 'listWeek'; }; const handleToday = () => { @@ -394,6 +399,7 @@ export default { calendarApi.value.changeView(newView); } }); + watch( allEvents, (newEvents) => { diff --git a/src/front/src/store/calendarStore.js b/src/front/src/store/calendarStore.js index 2c7cd8bc8..04af4741a 100644 --- a/src/front/src/store/calendarStore.js +++ b/src/front/src/store/calendarStore.js @@ -179,18 +179,14 @@ export const useCalendarStore = defineStore('calendarStore', () => { } // Если входные данные некорректны else { - console.error('Invalid date input:', dateInput); return false; } // Проверяем, что дата корректна if (isNaN(date.getTime())) { - console.error('Invalid date:', dateInput); return false; } - console.log('Processing date:', date); - const day = date.getDay(); // Проверка на выходной (суббота или воскресенье) @@ -202,10 +198,6 @@ export const useCalendarStore = defineStore('calendarStore', () => { const dayOfMonth = date.getDate(); const normalizedCurrentDate = `${year}-${String(month).padStart(2, '0')}-${String(dayOfMonth).padStart(2, '0')}`; - console.log('Current date:', normalizedCurrentDate); - // Логируем данные о праздничных днях - console.log(`Holidays for ${year}:`, holidays.value[year]); - console.log(`Holidays for ${year}-${month}:`, holidays.value[year]?.[month]); // Проверяем, что данные о праздничных днях существуют для текущего года и месяца const holidaysForYear = holidays.value[year] || {}; const holidaysForMonth = holidaysForYear[month] || []; @@ -213,30 +205,11 @@ export const useCalendarStore = defineStore('calendarStore', () => { // Проверка на исключение (рабочая суббота или праздничный будний день) const isExceptionDay = holidaysForMonth.includes(normalizedCurrentDate); - console.log('Is weekend:', isWeekend); - console.log('Is exception day:', isExceptionDay); - - return { isNonWorking: (isWeekend && !isExceptionDay) || (!isWeekend && isExceptionDay), isWeekendForStyling: isWeekend && !isExceptionDay, // только для серого фона isHoliday: !isWeekend && isExceptionDay, // только праздничный будний }; - // // Если день — суббота или воскресенье, но он в исключениях (рабочий), то не выходной - // if (isWeekend && isExceptionDay) { - // console.log('Working weekend day!'); - // return false; - // } - - // // Если день — будний, но он в исключениях (праздник), то выходной - // if (!isWeekend && isExceptionDay) { - // console.log('Holiday weekday!'); - // return true; - // } - - // // Во всех остальных случаях — стандартная логика - // console.log('Standard weekend logic.'); - // return isWeekend; }; // Открыть диалог создания/редактирования