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), }, }, });