Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Evenly expand timeGrid slots to fit height #265
This comes from Fit calendar to container stackoverflow question
I'm trying to make the fullcalendar fitting on the container without success. I've been modifying
Best calendar configuration I got looks like:
If I get dynamically the size and I set it:
The calendar expands, but only the last row, displaying an ugly last row like instead of increasing each row to fit the content. It looks like the following:
Is it possible to 'maximize' the calendar to fit the container?
Note: I can't resize the container and the container height is dynamic.
It's neccessary to add to
The difference at bottom can be obtained like:
And now we can add the difference to the actual height:
Still some pixels could appear below due to table borders.
You can check it in this plnkr
I realize this is a new feature request but upgrading from 2.0.2 to 2.4 it was quite the shock to see this 'gutter' appear at the bottom of the calendar when it was not previously there.
I think in the meantime it at least makes sense to be consistent. In 2.0.2 if aspectRatio was set to a value (height is left unset as is contentHeight) that resulted in the calendar being taller than the height of the slats, the calendar height would simply be truncated.
I am currently forcing this behavior by adding the following code immediately after initializing the calendar:
I ran into the same issue. I found another way to manage it. I'm using React but you could find where you can add this piece of code (on my side
Fullcalendar is listening for this
@Anton-V-K indeed it does, but the problem is that if you switch back to say, agendaWeek or month view, it then relies on contentHeight being auto - and it creates a gigantic table.
Docs on https://fullcalendar.io/docs/contentHeight are pretty useless in giving details on what contentHeight defaults to (only stating it uses aspectratio to 'calculate' the contentHeight) - is there any function we can call to set back to the default contentHeight after defaulting to "auto"?
If you're curious to know, this will be included in v5 (currently in-development)