Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event background color defined from an ressource #295

Closed
Daviruss1969 opened this issue Jul 10, 2024 · 4 comments
Closed

Event background color defined from an ressource #295

Daviruss1969 opened this issue Jul 10, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Daviruss1969
Copy link

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 !

@Daviruss1969
Copy link
Author

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.

@vkurko
Copy link
Owner

vkurko commented Jul 10, 2024

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 vkurko added the bug Something isn't working label Jul 10, 2024
@vkurko
Copy link
Owner

vkurko commented Jul 14, 2024

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

@vkurko
Copy link
Owner

vkurko commented Jul 17, 2024

I hope I can close this issue.

@vkurko vkurko closed this as completed Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants