findCalendarBoundaries
The findCalendarBoundaries hook allows you to modify the boundary that the calendar module allows you to display. The calendar module
always displays a certain month and generates links to the previous and next month, if there are events in that month. However, if you are
dynamically adding events via the getAllEvents you might want to override this boundary manually via this hook, so
that the calendar module still displays pagination links to the desired months.
Parameters
int
$dateFromUNIX timestamp of the lower boundary.
int
$dateToUNIX timestamp of the upper boundary.
int
$repeatUntilThe maximum
repeatEndvalue intl_calendar_eventsfor the selected archives.\Contao\Module
$moduleThe front end module instance executing this hook.
Example
// src/EventListener/FindCalendarBoundariesListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
use Contao\Module;
#[AsHook('findCalendarBoundaries')]
class FindCalendarBoundariesListener
{
public function __invoke(int &$dateFrom, int &$dateTo, int &$repeatUntil, Module $module): array
{
// Modify $dateFrom, $dateTo or $repeatUntil here
}
}