+ originalEvent: event
+ }
+ }))
+ )}
+ eventContent={(arg) => (
+
+
+
+ {arg.event.title}
+
{!arg.event.allDay && (
-
+
{new Date(arg.event.start).toLocaleTimeString('fr-FR', {
hour: '2-digit',
minute: '2-digit'
})}
- {arg.event.end && (
- <> - {new Date(arg.event.end).toLocaleTimeString('fr-FR', {
- hour: '2-digit',
- minute: '2-digit'
- })}>
- )}
-
- )}
- {arg.event.extendedProps.location && (
-
-
- {arg.event.extendedProps.location}
)}
- )}
- eventClassNames="rounded-md shadow-sm hover:shadow-md transition-shadow cursor-pointer"
- locale={frLocale}
- selectable={true}
- selectMirror={true}
- dayMaxEvents={true}
- weekends={true}
- select={handleDateSelect}
- eventClick={handleEventClick}
- height="auto"
- aspectRatio={1.8}
- slotMinTime="06:00:00"
- slotMaxTime="22:00:00"
- allDaySlot={true}
- allDayText="Toute la journée"
- slotLabelFormat={{
- hour: '2-digit',
- minute: '2-digit',
- hour12: false
- }}
- />
- )}
-
+ {arg.event.extendedProps.location && (
+
+
+ {arg.event.extendedProps.location}
+
+ )}
+
+ )}
+ eventClassNames={(arg) => {
+ // Generate a lighter version of the calendar color for the background
+ const color = arg.event.backgroundColor;
+ return [
+ 'rounded-md',
+ 'transition-all',
+ 'duration-200',
+ 'hover:shadow-md',
+ 'cursor-pointer',
+ `hover:translate-y-[-1px]`,
+ 'border-l-4'
+ ];
+ }}
+ eventBackgroundColor={(arg) => {
+ const color = arg.event.backgroundColor;
+ // Convert hex to RGB and lighten it
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(color);
+ if (result) {
+ const r = parseInt(result[1], 16);
+ const g = parseInt(result[2], 16);
+ const b = parseInt(result[3], 16);
+ return `rgba(${r}, ${g}, ${b}, 0.15)`;
+ }
+ return color;
+ }}
+ eventBorderColor={(arg) => arg.event.backgroundColor}
+ eventTextColor={(arg) => {
+ const color = arg.event.backgroundColor;
+ return color;
+ }}
+ locale={frLocale}
+ selectable={true}
+ selectMirror={true}
+ dayMaxEvents={false}
+ weekends={true}
+ select={handleDateSelect}
+ eventClick={handleEventClick}
+ height="auto"
+ aspectRatio={1.8}
+ slotMinTime="06:00:00"
+ slotMaxTime="22:00:00"
+ allDaySlot={true}
+ allDayText="Toute la journée"
+ slotLabelFormat={{
+ hour: '2-digit',
+ minute: '2-digit',
+ hour12: false
+ }}
+ />
+