Add clear selection button to DaySelector
This commit is contained in:
parent
9a5523d94b
commit
0d6ed2accb
@ -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'}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user