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

390
Views
how to add class in fullcalendar

i need to add class for specific booked and blocked days in fullcalendar, i need to highlight the booked and blocked days with different color. Try tried out with some code but not coming correctly

$("#calendar").fullCalendar({
    header: {
        left:   'title',
        center: '',
        right:  'prev,next'
    },
    selectable: true,
    events:[
        {
            title: 'Booked',
            start: '2017-03-11',
            end: '2017-03-22'
        },
        {
            title: 'Block',
            start: '2017-03-28',
            end: '2017-04-6'
        }
    ]
});
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Use eventRender function in your fullCalendar options:

eventRender: function(event, eventElement) {
    if (event.title == "Booked") {
      eventElement.css('background-color', 'green');
    }
  },

or add a class with jquery addClass

eventElement.addClass('yourClass');

you can also reference sub-elements if you need

eventRender: function(event, eventElement) {
    if (event.title == "Booked") {
      eventElement.find("a.fc-content").css('background-color', 'green');
    }
  },
over 4 years ago · Santiago Trujillo 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!