Search code examples
javascriptjqueryfullcalendarscheduleagenda

Full Calendar columnFormat leads to object object


I'm trying to change the column titles in agendaWeek to show only the day, eg Mon, instead of Mon 5/7. However, when I try to make any change, the column title becomes object object.Here's a screenshot.

I'm using version 3.4.0 of FullCalendar and jquery 2.1.1. Here's a snippet of my code:

$(document).ready(function() {

    $('#calendar').fullCalendar({
        header: false,
        defaultView: "agendaWeek",
        defaultDate: '2017-05-12',

        views: {
            agenda: {
                columnFormat: {
                month: 'dddd',    // Monday, Wednesday, etc
                week: 'dddd, MMM dS', // Monday 9/7
                day: 'dddd, MMM dS'  // Monday 9/7
            }
                // options apply to agendaWeek and agendaDay views
            }
        },
        navLinks: true, // can click day/week names to navigate views
        selectable: true,
        selectHelper: true,
        select: function(start, end) {
            var title = prompt('Event Title:');
            var eventData;
            if (title) {
                eventData = {
                    title: title,
                    start: start,
                    end: end
                };
                $('#calendar').fullCalendar('renderEvent', eventData, true); // stick? = true
            }
            $('#calendar').fullCalendar('unselect');
        },
        editable: true,
        eventLimit: true, // allow "more" link when too many events

Solution

  • try setting the slotLabelFormat under views agenda like this

    views: {
        agenda: {
            slotLabelFormat: 'ddd',
        }
    }