I am getting an error when trying to store information about selected time in state. Any help is appreciated, thank you for your time! Please let me know if you guys are needing anymore specific information.
Following is my code snippet from my component:
const Calendar = (props) => {
const [startTime, setStartTime] = React.useState('');
const handleSelect = (selectedInfo) => {
//alert(selectedInfo.startStr);
setStartTime(selectedInfo.startStr);
}
return (
<FullCalendar
defaultView="timeGridWeek"
weekends={false}
allDaySlot={false}
plugins={[ timeGridPlugin, dayGridPlugin, interactionPlugin ]}
minTime="08:00:00"
selectable={true}
selectMirror={true}
selectOverlap={false}
select={handleSelect}
header={{
left: 'prev,next today',
center: 'title',
right: 'dayGridMonth,timeGridWeek,timeGridDay'
}}
events={[
{ title: 'event 1', start: '2020-03-16 10:00:00', end: '2020-03-16 12:00:00' },
{ title: 'event 2', start: '2020-03-19' }
]}
/>
);
}