calendar icon indicating copy to clipboard operation
calendar copied to clipboard

Event background color defined from an ressource

Open LukasLoiodice opened this issue 1 year ago • 3 comments

Hello,

I have an issue with setting the background color of an event according to the resources, I might be doing something wrong but I read the documentation and my code seems logic.

In the timeline view, the resources are correctly set with the event.

Settings the color directly in the event or globally works fine.

Here's my options :

  calendar = new Calendar({
    target: canva.value,
    props: {
      plugins: [TimeGrid, Interaction, List, RessourceTimeline],
      options: {
        view: 'timeGridWeek',
        nowIndicator: true,
        eventStartEditable: false,
        eventDurationEditable: false,
        dateClick: dateClickCallback,
        eventClick: eventClickCallback,
        headerToolbar: {
          start: 'today prev,next',
          center: 'title',
          end: 'timeGridDay,timeGridWeek,listWeek,resourceTimelineWeek'
        },
        events: [
          {
            title: 'Test 1',
            start: '2024-07-10T08:00:00',
            end: '2024-07-10T10:00:00',
            resourceIds: [0]
          },
          { 
            title: 'Test 2',
            start: '2024-07-10T09:30:00',
            end: '2024-07-10T13:50:00',
            resourceIds: [1]
          },
          {
            title: 'Test 3',
            start: '2024-07-11T15:15:00',
            end: '2024-07-11T17:45:00',
            resourceIds: [0, 1]
          }
        ],
        resources: [
          {
            id: 0,
            title: 'Lukas',
            eventBackgroundColor: 'red'
          },
          {
            id: 1,
            title: 'Jhon',
            eventBackgroundColor: 'green'
          }
        ]
      }
    }
  })

And the results : image

Thanks for your work !

LukasLoiodice avatar Jul 10 '24 08:07 LukasLoiodice

I have an update, it works now, I added the @event-calendar/resource-time-grid plugin and I got the colors. I leave this, I don't know if it's an issue or not.

LukasLoiodice avatar Jul 10 '24 08:07 LukasLoiodice

I confirm that the problem exists. This should work without having to use @event-calendar/resource-time-grid. I will fix this in a future version. Thank you for reporting.

vkurko avatar Jul 10 '24 08:07 vkurko

The problem should be fixed in Event Calendar v3.2.0. Please check.

vkurko avatar Jul 14 '24 13:07 vkurko

I hope I can close this issue.

vkurko avatar Jul 17 '24 13:07 vkurko