Anu
Anu

Reputation: 925

Full calendar events default display shows start time

Using Fullcalender.js , i am showing events in calendar . I added dayclick and event click funtionality. But when i use date.format() in dayClick (), it shows error date.Format() is not the function. I upgraded my fullcalendar to v3.5.1 , after that i can get dayClick functionality very well. But the events showing Start time as default even if im not giving any title to it.

$(document).ready(function() {

    $('#ConfCalendarBlock').fullCalendar({      

        height:400,
        editable: true,             
        events: modJs.getConfJsonUrl(),         
        loading: function(bool) {
            if (bool) $('#loadingConfCalendarBlock').show();
            else $('#loadingConfCalendarBlock').hide();
        },          
        dayClick: function (date, jsEvent, view) {           
                modJs.getdayclick(date.format());               
        },          
        eventClick: function(calEvent, jsEvent, view) { 
            modJs.getEventClcik(calEvent.id);
        },       

    });

});

in my php code

public function listToEvent($book){

        $event = array();

        $starttime = date("g:i a", strtotime($book->from_date));
        $endtime = date("g:i a", strtotime($book->to_date));

        $event['id'] = $book->id;

        $event['title'] = $starttime."-".$endtime. " (".$book->type.")";
        $event['start'] = $book->from_date;
        $event['end'] = $book->to_date;
        $eventBackgroundColor = "";

        $event['color'] = $eventBackgroundColor;
        $event['backgroundColor'] = $eventBackgroundColor;
        $event['textColor'] = "#FFF";

        return $event;
    }

Calendar shows the event as

9:15a 9:15am - 10:30am (Meeting)

The start time shows twice ,but if i refer old version of Calendar, it shows as i want. Even i didnt give any title to the event, then the calendar shows the start time as 9:15a in blue color event bar.

Upvotes: 1

Views: 990

Answers (1)

Thomas Ayoub
Thomas Ayoub

Reputation: 29431

It seems you need to set displayEventTime to false

Upvotes: 1

Related Questions