import React, { useState, useEffect, useRef } from 'react'; import Calendar from '@toast-ui/react-calendar'; import "tui-calendar/dist/tui-calendar.css"; import "tui-date-picker/dist/tui-date-picker.css"; import "tui-time-picker/dist/tui-time-picker.css"; function Cal(calledday) { const calendarRef = useRef(); const [day, setDay] = useState(calledday + "15:00:00"); const [myTheme, setMyTheme] = useState({ 'common.dayname.color': '#333', 'common.today.color': '#333', // 'common.creationGuide.color': 'white', 'common.creationGuide.backgroundColor': 'gray', // Theme object to extends default dark theme. }); useEffect(() => { const cal = calendarRef.current.getInstance(); cal.setDate(new Date(day)); cal.changeView('week', false); // cal.today(new Date(day)); // calendar.on('clickSchedule', function (event) { // const schedule = event.schedule; // if (lastClickSchedule) { // calendar.updateSchedule(lastClickSchedule.id, lastClickSchedule.calendarId, { // isFocused: false, // }); // } // calendar.updateSchedule(schedule.id, schedule.calendarId, { // isFocused: true, // }); // lastClickSchedule = schedule; // // open detail view // return (console.log(isFocused)) // }); }, [day]) return ( ) } export default Cal