I finally came up with using onSelectSlot
and hiding multi-selecting effect manually using css, it's not perfect but its working!
<BigCalendar
view="month"
onNavigate={onNavigate}
culture="en-GB"
date={currentDate}
selectable={true}
onSelectEvent={onSelectEvent}
onSelectSlot={onSelectSlot}
onView={() => {}}
localizer={localizer}
events={events}
/>
Using end of selected slot as selected day: (I know it's not perfect!)
const onSelectSlot = (slotInfo: {
start: stringOrDate;
end: stringOrDate;
slots: Date[] | string[];
action: 'select' | 'click' | 'doubleClick';
}) => {
// use moment(slotInfo.end) as selected day!
};
Hiding multi-selecting effect using css:
calendar: {
'& > .rbc-calendar': {
width: '100%',
minHeight: '500px',
},
'& .rbc-month-view': {
border: 'none',
'& .rbc-event': {
paddingLeft: '2px',
borderRadius: 3,
backgroundColor: theme.palette.secondary.main,
},
'& .rbc-now': {
color: theme.palette.secondary.main,
},
'& .rbc-selected-cell': {
backgroundColor: '#fff',
},
'& .rbc-today.rbc-selected-cell': {
backgroundColor: '#eaf6ff',
},
'& .rbc-off-range-bg.rbc-selected-cell': {
background: '#e6e6e6',
},
'& .rbc-month-row': {
cursor: 'pointer',
},
},
},