46

On FullCalendar, in the month view, is there a way to hide an event's start time?

Theo
  • 461
  • 1
  • 4
  • 4

14 Answers14

74

Just add to calendar options

displayEventTime: false
andrey
  • 1,136
  • 9
  • 19
  • This option is available from v2.4.0 see http://fullcalendar.io/docs/text/displayEventTime - You need to set it as option of fullCalendar and it affects all events. Or use CSS `.fc-time{ display : none; }`. However, I need to set the visibility of each event time differently and it seems that this is not possible. – Avatar Dec 16 '15 at 12:30
33

add the following style to your css

.fc-event-time{
   display : none;
}

or in version 2+:

.fc-time{
   display : none;
}
biesior
  • 55,576
  • 10
  • 125
  • 182
Riz
  • 1,055
  • 11
  • 18
23

Try this, it works for me:

$('#calendar').fullCalendar({
     displayEventTime : false
});

That should hide the start time in the title event.

Raymond
  • 1,309
  • 14
  • 10
15

To hide them all, the following should work

$('#calendar').fullCalendar({
 displayEventTime : false
});   

But if you (like me) were trying to hide the time of a specific event, I found pretty clean way.

Just create the following CSS class and refer to it in the event property "className":

.hideCalendarTime > div > span.fc-time{
    display:none;
}

And your event should look something like this:

var newEvent = new Object();
newEvent.title = "Something";
newEvent.start = new Date();
newEvent.allDay = false;
newEvent.className = "hideCalendarTime";
Thiago A
  • 151
  • 1
  • 4
11

The following hides the date on the month view only:

.fc-view-month .fc-event-time{
    display : none;
}
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
8

Another way is to add an eventRender function. This way you can choose to not render the time, and do something else like append some data to the event.

eventRender: function(event, element) { 
    element.find('.fc-event-title').append("<br/>" + event.location); 
    element.find('.fc-event-time').hide();
}
Catfish
  • 18,876
  • 54
  • 209
  • 353
5

remind that the CSS class name has changed to

.fc-time {
    display:none;
}
AJ H
  • 687
  • 6
  • 8
3

In case you completely want to remove the Start time, you can use the below code

$('#calendar-canvas').fullCalendar({
    header: {
        left: 'today prev,next title',
        right: 'agendaDay,agendaWeek,month'
    },
    firstDay: 1,
    eventRender: function(event, element) {
        $(element).find(".fc-event-time").remove();
    }
});
Stijn Bernards
  • 1,091
  • 11
  • 29
2

According to http://fullcalendar.io/docs/text/timeFormat/ , you just need to set time format in fullCalendar settings:

$('#calendar').fullCalendar({
    events: [              
    ],
    timeFormat: ' '
});
2

I know it has been three months since you asked the question. But, if you and I are trying to do the same thing than someone else may be looking for the answer.

In the fullcalendar.js file, comment line 1603:

htmlEscape(formatDates(event.start, event.end, view.option('timeFormat'), options)) +

This is not a fix, at best it is a hack, but it works.

Bill
  • 21
  • 3
0

Although @Riz was correct at the time of posting, the css has changed in recent versions and now you'd need the following.

.fc-day-grid-event .fc-time{
    display:none;
}
Chris Traverse
  • 113
  • 1
  • 10
0
.fc-time-grid-event.fc-short .fc-time,.fc-time-grid-event .fc-time{
        display: none !important;
    }

Above code will correct it in all views.

code below has a flow that shows time in large view of event

 .fc-time-grid-event.fc-short .fc-time{
            display: none !important;
        }

please use this code in css to hide the time only from event.

using just

.fc-time{
        display: none !important;
    }

will also hide the time at left grid.

Ravi S. Singh
  • 617
  • 8
  • 15
0

Just remove allDay: false, from your fullCalendar function

Elyor
  • 5,396
  • 8
  • 48
  • 76
0

displayEventTime: false but you need to add allDay=false in event data resources { "title": "e", "start": "2022-04-17T16:02:21", "allDay": false }