frontend/src/components/Schedule/DaySelector.js

27 lines
752 B
JavaScript

import React from 'react';
import FullCalendar from '@fullcalendar/react';
import dayGridPlugin from '@fullcalendar/daygrid';
import interaction from '@fullcalendar/interaction';
import './DaySelector.less';
export default function DaySelector({ eventsList, handleSelect, handleClear }) {
return (
<FullCalendar
plugins={[dayGridPlugin, interaction]}
initialView='dayGridMonth'
// showNonCurrentDates={false}
selectable={true}
// unselectAuto={false}
longPressDelay={150}
select={(info) => handleSelect(info)}
defaultAllDay={true}
events={eventsList}
customButtons={{
resetSelection: { text: 'clear selection', click: handleClear },
}}
headerToolbar={{ right: 'resetSelection today prev,next' }}
/>
);
}