Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the default timeslot height be set in FullCalendar?

Tags:

fullcalendar

It looks like the default is 20px, but I was hoping to bump this up, so an event that is the length of 1 timeslot would be able to show the event header and body. Currently when an event is the length of 1 timeslot only the event header is shown.

like image 656
SomethingOn Avatar asked Aug 31 '11 14:08

SomethingOn


3 Answers

Fullcalendar Version 5

.fc-timegrid-slot {
    height: 30em; // 1.5em by default
    border-bottom: 0 !important;
}
like image 130
孙悟空 Avatar answered Sep 21 '22 23:09

孙悟空


Anyone still looking for the answer in new versions. In the new version (v3.9.0), change the css to:

.fc-time-grid .fc-slats td {
  height: 2em; // Change This to your required height
  border-bottom: 0;
}

NOTE: this does not affect the drag-drop or resizing for me.

like image 30
Rohin Tak Avatar answered Sep 18 '22 23:09

Rohin Tak


In fullcalendar.css you can change this line to adjust the timeslot height

.fc-agenda-slots td div { height: 20px; }

So if you your shortest event is half the timeslot length (30min event, but 1hr timeslot) you would double this value


CAVEAT: As pointed out by jjnguy this change will break the drag/drop and resize functionality. It solves the problem of changing the default timeslot height though.

like image 28
SomethingOn Avatar answered Sep 19 '22 23:09

SomethingOn