Fullcalendar does not show the event database at the time of the event

I am creating an event calendar within the Hero Framework. I have a fullcalendar linked to DB via JSON method. The recording starts at "2012-04-18 12:00" and ends at "2012-04-18 14:00", but the calendar was unable to show the event base at the time. It is shown as an ALL-DAY event. Any idea how to solve this?

<script type='text/javascript'>

$(document).ready(function() {

    var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();

    var calendar = $('#calendar').fullCalendar({
        header: {
            left: 'prev,next today',
            right: 'month,agendaWeek,agendaDay'
        },
        selectable: true,
        selectHelper: true,
        allDaySlot: false,
        firstHour: 9,
        select: function(start, end) {
            var title = prompt('Event Title:');
            if (title) {
                calendar.fullCalendar('renderEvent',
                    {
                        title: title,
                        start: start,
                        end: end
                    },
                    false // make the event "stick"
                );

                var startDateString = $.fullCalendar.formatDate(start, 'yyyy-MM-dd hh:mm');
                var endDateString = $.fullCalendar.formatDate(end, 'yyyy-MM-dd hh:mm');
                $.ajax({
                    type: 'POST',
                    url: '{url}ajaxpost/add',
                    data: {
                        startDate: startDateString,
                        endDate: endDateString,
                        eventTitle: title                            
                    },
                    dateType: 'json',
                    success: function (resp) {
                        calendar.fullCalendar('refetchEvents');

                    }
                });
            }
            calendar.fullCalendar('unselect');
        },
        editable: true,
        events: "{url}ajaxget/data",
    });

});

      

+3


source to share


2 answers


you need to set allDay property of the event to false



+3


source


When you return events from your url {url}ajaxget/data

, you need to indicate that this event is not all day.

You perform this setting in the field allDay

on every event

one that is not for the whole day.

It might look like this:



[{
    start : 10000000,
    end :   10000500,
    title : 'example event'
    allDay : false
}, ... ]

      

You can also find this information in the documentation .

+1


source







All Articles