Add clear selection button to DaySelector

This commit is contained in:
rui hildt 2020-05-30 16:03:05 +02:00
parent 9a5523d94b
commit 0d6ed2accb
1 changed files with 6 additions and 0 deletions

View File

@ -70,6 +70,10 @@ export default function DaySelector() {
setEventsList(updatedEvents);
};
const handleClear = () => {
setEventsList([])
}
return (
<FullCalendar
initialView='dayGridMonth'
@ -79,6 +83,8 @@ export default function DaySelector() {
select={(info) => handleSelect(info)}
defaultAllDay={true}
events={eventsList}
customButtons={{resetSelection:{text: 'clear selection', click: handleClear}}}
headerToolbar={{right: 'resetSelection today prev,next'}}
/>
);
}