Limiting Calendar Display to Business Hours: Is It Possible?

Hello. I'm using this plugin in some systems and I'm facing a specific issue. I would like to know if it's possible to limit the hours displayed on the calendar. For example, I need the calendar to only show business hours, from 8 am to 6 pm. Does anyone know if this configuration is possible?
No description
2 Replies
Sjoerd24
Sjoerd243mo ago
Yes you can add this in the config:
public function config(): array
{
return [
//'aspectRatio' => 2.0,
'headerToolbar' => [
'left' => 'prev,next today',
'center' => 'title',
'right' => 'resourceTimeGridDay',
],
'nowIndicator' => true,
'selectable' => false,
'editable' => false,
'height' => 'auto',
'views' => [
'resourceTimeGridDay' => [
'slotMinTime' => '07:00:00',
'slotMaxTime' => '18:00:00',
],
];
}
public function config(): array
{
return [
//'aspectRatio' => 2.0,
'headerToolbar' => [
'left' => 'prev,next today',
'center' => 'title',
'right' => 'resourceTimeGridDay',
],
'nowIndicator' => true,
'selectable' => false,
'editable' => false,
'height' => 'auto',
'views' => [
'resourceTimeGridDay' => [
'slotMinTime' => '07:00:00',
'slotMaxTime' => '18:00:00',
],
];
}
SlotminTime and MaxTime is what you need. The docs for fullcalendar are a good resource. I found almost all posibilities i think, so write me for more help if needed. (i left on purpose some stuff in above)
Guariero
Guariero3mo ago
Thank you very much for your help, I had to approach it in another way, as it still didn't provide the timetable I wanted. I did it as follows public function config(): array { return [ 'firstDay' => 0, 'editable' => false, 'slotMinTime' => '07:00:00', 'slotMaxTime' => '19:00:00', 'headerToolbar' => [ 'right' => 'title', 'center' => null, 'left' => 'prev,next today', ], 'height' => 'auto', ]; } }