-1

I'm using fullcalendar to show events from database but on the same event I want to some days red(danger) and some days blue(default) in accordance with a fields on database. Is it possible?

Rahn
  • 4,787
  • 4
  • 31
  • 57

1 Answers1

0

Yes you can. You can specify color in your events to change color. Example:

  [
    [
        title: Red,
        color: #DC143C
    ],
    [
        title: Blue,
        color: #00FFFF
    ]
]

You can also change it dynamically using eventRender callback as following example:

    eventRender: function(event, element) {
                if(event.title=="Red")
                    element.css('background-color', '#DC143C');
                if(event.title=="Blue")
                    element.css('background-color', '#00FFFF');

}

Saurav Dangol
  • 894
  • 2
  • 10
  • 27