This HTML structure has events outside the time container, where the height position is calculated by JavaScript and will vary depending on the number of events. The maximum achievement that can be achieved is to maintain the existing space through visibility: hidden. Using display: none will change the calculation of the event’s position.
.task-Calendar .rbc-time-gutter.rbc-time-column > div:nth-child(-n+8),
.task-Calendar .rbc-day-slot.rbc-time-column > div:nth-child(-n+8){
visibility: hidden;
}
.task-Calendar .rbc-time-gutter.rbc-time-column > div:nth-child(n+20):nth-child(-n+24),
.task-Calendar .rbc-day-slot.rbc-time-column > div:nth-child(n+20):nth-child(-n+24) {
visibility: hidden;
}
.rbc-time-content > div:not(:nth-child(-n+8)):not(:nth-child(n+20)):not(:last-child) {
pointer-events: none;
}