3
votes

I am using the fullcalendar plugin for my angular application. I am using eventSource to get my events. I have title, start, end and breakCount keys in my JSON, like this:

{
    "title": "06DefaultProgram2",
    "start": "2016-02-06 13:30:00",
    "end": "2016-02-06 18:00:00",
    "breakCount": 2
}  

Full calendar takes title, start and end but I also want to display the breakCount on my event cell. How can I achieve this?

2
Is it that plugin? fullcalendar.ioPartha Sarathi Ghosh
yes its a plugin for handling calender eventsNitish Hardeniya

2 Answers

1
votes

You can add a callback function for the eventRender event. Docs are at http://fullcalendar.io/docs/event_rendering/eventRender/

The eventRender Event will pass the event object and the element pre built with the unmodified html element that would normally be displayed. In the code you write for this event handler you refer to the custom property by name as event.breakCount. Within the code you write in this event handler you can either modify the element parameter to display the value of event.breakCount (Maybe concatenating it to the end of existing title text), or create and pass back an entirely new element to display the event. You have full control over presentation of the event in this handler.

-1
votes

You can make this possible as below.

Attach your breakCount in title

{
    "title": "06DefaultProgram2<br>2", // 2 is your breakCount, you have to manage this in your server script.
    "start": "2016-02-06 13:30:00",
    "end": "2016-02-06 18:00:00",

}