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

View File

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