21

I am trying to build an application that creates events within fullcalendar. I don't allow user to create an "allDay" event at all at the client side but they still can see it within the view. Is there any method to remove allDays from views completely?

function initCalendar {
    if (!jQuery().fullCalendar) {
        return;
    }

    var date = new Date(),
        started,
        ended

    var header = {};

    var calendar = $('#calendar').fullCalendar({
        header: header,
        selectable: true,
        selectHelper: true,

        select: function (start, end, allDay) {
            $('#fc_create').click();
            var dateStart = start; 
            var dateEnd = end;

            $(".antosubmit").on("click", function() {
                var title = $("#reservation-title").val();

                if (title) {
                    var event = {
                        editable: true,
                        title: title,
                        start: dateStart,
                        end: dateEnd,
                        allDay: false
                    }

                    calendar.fullCalendar('renderEvent', event, true);
                    calendar.fullCalendar('unselect');
                    #('.antoclose').click();

                    return false;
                }
                else {
                    ////alert here
                }
            })
        }
    })
}
KaraKaplanKhan
  • 734
  • 1
  • 14
  • 31

1 Answers1

55

From the docs:

allDaySlot: false

https://fullcalendar.io/docs/agenda/allDaySlot/

** Update for v5: https://fullcalendar.io/docs/allDaySlot

jhen
  • 1,164
  • 1
  • 11
  • 24