var AppCalendar = function() {
    return {
        init: function() {
            this.initCalendar()
        },
        initCalendar: function() {
            if (jQuery().fullCalendar) {
                $("#calendar").fullCalendar({
                    defaultView: "agendaWeek",
                    slotMinutes: 5,
                    lang: 'es',
                    events: function(start, end, timezone, callback) {
                        $.ajax({
                            url: route,
                            type: 'POST',
                            data: {
                                start: start.unix(),
                                end : end.unix()
                            },
                            success: function (data) {
                                callback(data);
                            }
                        });
                    }
                });
            }
        }
    }
}();
jQuery(document).ready(function() {

    AppCalendar.init();

});