You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.
We are using EXT:eventnews v1.1.1
cb_newscal won't show the end of the event if its exceeding a month/year.
For example:
Create an event (news-entry with isEvent==TRUE) from 23th February 2017 until 5th March 2017 - now the event will stop (not end) on February 28, even though the calendar shows the day.
Don't know if that's wanted to happen - but since you see the day in February...
Also you can't see the event from March 1 to March 5 because the actual entry is in February.
Attached is a sample how I fixed it manually to at least show entrys beginning in the last month and the last year when jumping DEC->JAN.
Edit: 18. September 2017: I updated the example code because after a recent update to TYPO3 LTS 7 with PHP 7 the code failed. Only change: I added a if(!empty(...)) check in front of the foreach loops. Still works with PHP 7, LTS 7
protected function getEventsOfDay($demand, &$day)
{
if (!isset($this->events[$day['year']]))
$this->events[$day['year']] = array();
if (!isset($this->events[$day['year']][$day['month']]))
{
// # BEGIN CHANGES 4. JANUARY 2017 - Problem with DEC/JAN
// # BEGIN CHANGES 14. FEBRUARY 2017 - Problem with MONTH-End
`
// January - We check last Month, too (Year-1 and Month = 12)
if ($day['month'] == 1)
{
$demand->setYear($day['year']-1);
$demand->setMonth(12);
$eventsPlus1 = $this->newsRepository->findDemanded($demand);
}
// Next Month - We check the last Month, too (Month-1 and Day = 1-31)
$demand->setMonth($day['month']-1);
$eventsPlus2 = $this->newsRepository->findDemanded($demand);
// Current Year + Month - These 3 lines were before the changes, rest is new!
$demand->setYear($day['year']);
$demand->setMonth($day['month']);
$this->events[$day['year']][$day['month']] = $this->newsRepository->findDemanded($demand);
// Merging - Adding the Plusevents1 to the array:
if (!empty($eventsPlus1))
{
foreach ($eventsPlus1 as $k => $event)
{
$this->events[$day['year']][$day['month']][] = $event;
}
}
// Merging - Adding the Plusevents2 to the array:
if (!empty($eventsPlus2))
{
foreach ($eventsPlus2 as $k => $event)
{
$this->events[$day['year']][$day['month']][] = $event;
}
}
// Debugging:
//\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($eventsPlus, 'January - We check last Month also(Year-1,Month = 12)');
//\TYPO3\CMS\Core\Utility\DebugUtility::debug($day['cd']);
//$debug = [ "EVENT->TITLE" => $event->getTitle(),
// "DAY" => $day['cd'],
// "DEMAND->DATEFIELD" => $demand->getDateField(),
// "EVENT->DATETIME" => $event->getDatetime(),
// "EVENT->EVENTEND" => $event->getEventEnd(),
// ];
//\TYPO3\CMS\Core\Utility\DebugUtility::debug("++");
//\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump($debug, 'DEBUG');
// # END CHANGES 14. FEBRUARY 2017 - Problem with MONTH-End
// # END CHANGES 4. JANUARY 2017 - Problem with DEC/JAN
}
$day['startev'] = True;
$day['endev'] = True;
$day['news'] = array();
...
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey, thanks for the extension.
We are using EXT:eventnews v1.1.1
cb_newscal won't show the end of the event if its exceeding a month/year.
For example:
Create an event (news-entry with isEvent==TRUE) from 23th February 2017 until 5th March 2017 - now the event will stop (not end) on February 28, even though the calendar shows the day.
Don't know if that's wanted to happen - but since you see the day in February...
Also you can't see the event from March 1 to March 5 because the actual entry is in February.
Attached is a sample how I fixed it manually to at least show entrys beginning in the last month and the last year when jumping DEC->JAN.
File: /cb_newscal/Classes/Controller/NewsController.php
Class: NewsController
Function: getEventsOfDay
Edit: 18. September 2017: I updated the example code because after a recent update to TYPO3 LTS 7 with PHP 7 the code failed. Only change: I added a if(!empty(...)) check in front of the foreach loops. Still works with PHP 7, LTS 7
The text was updated successfully, but these errors were encountered: