From 33cd40038f1ebcc3fd32fccc6fa28a3b1d6da05f Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Tue, 25 Mar 2025 10:44:09 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BB=A4=EC=8A=A4=ED=85=80=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/vacation/VacationManagement.vue | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/views/vacation/VacationManagement.vue b/src/views/vacation/VacationManagement.vue index 43693a8..1422758 100644 --- a/src/views/vacation/VacationManagement.vue +++ b/src/views/vacation/VacationManagement.vue @@ -127,6 +127,19 @@ const hasChanges = computed(() => { ); }); +// 캘린더 이동 함수 (이전, 다음, 오늘) +const moveCalendar = async (value = 0) => { + const calendarApi = fullCalendarRef.value?.getApi(); + + if (value === 1) { + calendarApi.prev(); // 이전 달로 이동 + } else if (value === 2) { + calendarApi.next(); // 다음 달로 이동 + } else if (value === 3) { + calendarApi.today(); // 오늘 날짜로 이동 + } +}; + /* 캘린더 설정 */ // 풀 캘린더 옵션,이벤트 const calendarOptions = reactive({ @@ -144,9 +157,17 @@ const calendarOptions = reactive({ datesSet: handleMonthChange, events: calendarEvents, customButtons: { + prev: { + text: 'PREV', + click: () => moveCalendar(1), + }, today: { text: 'TODAY', - click: () => fullCalendarRef.value?.getApi().today(), + click: () => moveCalendar(3), + }, + next: { + text: 'NEXT', + click: () => moveCalendar(2), }, }, });