aldabil21 / react-scheduler

React scheduler component based on Material-UI & date-fns
The Unlicense
361 stars 129 forks source link

custom event renderer not working in month view #163

Closed thomasouvre closed 1 year ago

thomasouvre commented 1 year ago

Hi,

I wonder why the use of the eventRenderer props is disabled in month view? Is there any workaround to display the hours of an event on the month view?

By the way thanks for your works !

EDIT:

A workaround could be to set on the container following css:

<Paper sx={{
  '& .MuiTypography-root.MuiTypography-subtitle2': {
    whiteSpace: 'pre-line'
  }
}}>

Then modify the event title to include a break line between hours and title:

{
  event_id: e.id,
  title: `${format(e.start, "hh'H'mm", { locale: fr })} - ${format(end, "hh'H'mm", { locale: fr })}\n${e.title}`,
  start: e.start,
  end: end
}

But there is overlap between two events in the same day... And the 'More' button seems to be broken. Any help will be appreciated. Thanks by advance.

aldabil21 commented 1 year ago

But there is overlap between two events in the same day

Basically, this is exactly why, in the code, its here: https://github.com/aldabil21/react-scheduler/blob/23b93c739d63ae3bb44766092f9cd7ab5804256e/src/lib/components/events/EventItem.tsx#L184

Month & multiday are to narrow and tight and basically can lead to mistakes. I thought its better to keep it controlled.