Skip to content

Commit

Permalink
Fixed event reader crash by adding a private function from Contao source
Browse files Browse the repository at this point in the history
  • Loading branch information
hschottm committed Sep 25, 2020
1 parent ef48b90 commit a8029bf
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions modules/ModuleEventReaderTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,4 +405,37 @@ protected function compile()

$this->Comments->addCommentsToTemplate($this->Template, $objConfig, 'tl_calendar_events', $objEvent->id, $arrNotifies);
}

/*
* copied from ModuleEventReader
*/
private function getDateAndTime(CalendarEventsModel $objEvent, PageModel $objPage, $intStartTime, $intEndTime, $span)
{
$strDate = Date::parse($objPage->dateFormat, $intStartTime);

if ($span > 0)
{
$strDate = Date::parse($objPage->dateFormat, $intStartTime) . $GLOBALS['TL_LANG']['MSC']['cal_timeSeparator'] . Date::parse($objPage->dateFormat, $intEndTime);
}

$strTime = '';

if ($objEvent->addTime)
{
if ($span > 0)
{
$strDate = Date::parse($objPage->datimFormat, $intStartTime) . $GLOBALS['TL_LANG']['MSC']['cal_timeSeparator'] . Date::parse($objPage->datimFormat, $intEndTime);
}
elseif ($intStartTime == $intEndTime)
{
$strTime = Date::parse($objPage->timeFormat, $intStartTime);
}
else
{
$strTime = Date::parse($objPage->timeFormat, $intStartTime) . $GLOBALS['TL_LANG']['MSC']['cal_timeSeparator'] . Date::parse($objPage->timeFormat, $intEndTime);
}
}

return array($strDate, $strTime);
}
}

0 comments on commit a8029bf

Please sign in to comment.