Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
different header color for each resource in fullcalendar v5.9

I am working on fullcalendar v5.9 with resources, I want each resource has different background column color or different background header color. how can I do that?

   var calendar = new FullCalendar.Calendar(calendarEl, {

                initialView: 'resourceTimeGridTwoDay',
                initialDate: dnew Date(),
                locale: 'it',
                selectable: true,
                dayMaxEvents: true, // allow "more" link when too many events
                 
                eventTimeFormat: { // like '14:30:00'
                    hour: '2-digit',
                    minute: '2-digit',
                    hour12: false,
                    meridiem: false
                },
                slotLabelFormat: { // like '14:30:00'
                    hour: '2-digit',
                    minute: '2-digit',
                    hour12: false,
                    meridiem: false
                },
                headerToolbar: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'resourceTimeGridDay,resourceTimeGridTwoDay,resourceTimeGridWeek'
                },
                views: {
                    resourceTimeGridTwoDay: {
                        type: 'resourceTimeGrid',
                        duration: { days: 3 },
                        buttonText: '3 days',
                        slotDuration: '00:15',
                        slotMinTime: '08:00',
                        slotMaxTime: '21:15',
                    }
                },
                resources: [
                   { id: 'a', title: 'Room A' },
                   { id: 'b', title: 'Room B', eventColor: 'green' },
                   { id: 'c', title: 'Room C', eventColor: 'orange' },
                   { id: 'd', title: 'Room D', eventColor: 'red' }
                ],
                
                events: events2
                
                           
            });

            calendar.render();
        };
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I solved it. I add this section to fullcalendar code

  resourceLabelDidMount: function (info) {                        
      if (info.resource.id == 2)
        info.el.style.backgroundColor = 'red';                        
  },
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!