Manjit Singh
Manjit Singh

Reputation: 255

change the event color of two different events of fullcalendar?

i am working with full calendar and i want to apply a condition in which the appointment accepted events looking in green color and pending request appointments look in red color. How can i apply different colors to different-2 events?

Upvotes: 0

Views: 962

Answers (1)

brasofilo
brasofilo

Reputation: 26055

I'm using the callback eventRender, checking the properties for a specific string and changing the color through jQuery:

eventAfterRender: function ( event, element ) {
    console.log( event ); // Debug
    if( event.title.indexOf("Pending") > -1 ) { // if title contains "Pending"
        element.css( {'background-color': '#14B9E2', 'border': '1px solid #14B9E2'} );
    }
}

Upvotes: 1

Related Questions