FullCalendar Annotations

In the current version of FullCalendar, can annotations be used, as indicated in this link ? See this fiddle that doesn't work, for example:

$(document).ready(function() {
    var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();

    $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            center: 'title',
            right: 'month,agendaWeek,agendaDay'
        },
        editable: true,
        annotations: [{
            start: new Date(y, m, d-2, 13, 30),
            end: new Date(y, m, d-2, 14, 00),
            title: 'Blocked Day',
            cls: 'open',
            color: '#777777',
            background: '#000'
        }],
        events: [{
            title: 'Birthday Party',
            start: new Date(y, m, d+1, 19, 0),
            end: new Date(y, m, d+1, 22, 30),
            allDay: false
        }]
    });     
});
+3
source share
1 answer

In the presented example, you set the script to execute in the load event

$(window).load(function() {
      //your code
});

JsFiddle, , , $(document).ready(), <head> . http://jsfiddle.net/Ppnw3/1/, , github http://jsfiddle.net/Ppnw3/2/

+1

All Articles