Version 4.7.8
This commit is contained in:
1 parent
7b7404e741
commit
fd22d99e69
688 files changed
+19814
-10890
No files matched your search
@@ -472,7 +472,7 @@ class _Event extends \IPS\Content\Item implements
|
||||
$results[] = array( 'startDate' => $date, 'endDate' => $eDate );
|
||||
}
|
||||
|
||||
/* Figure out which of teh days is next. For example, if the start date is a Wednesday, and the
|
||||
/* Figure out which of the days is next. For example, if the start date is a Wednesday, and the
|
||||
event repeats every Monday and Friday, we need to start with Friday (not Monday) because that's
|
||||
when the first occurance is */
|
||||
$nextTimes = array();
|
||||
@@ -1053,6 +1053,28 @@ class _Event extends \IPS\Content\Item implements
|
||||
|
||||
return $this->dateObjects['end'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the live topic, or NULL if one not available
|
||||
*
|
||||
* @return \IPS\cloud\LiveTopic|null
|
||||
*/
|
||||
public function get__livetopic_id(): ?\IPS\cloud\LiveTopic
|
||||
{
|
||||
if ( ! \IPS\Application::appIsEnabled('cloud') )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return \IPS\cloud\LiveTopic::load( $this->livetopic_id );
|
||||
}
|
||||
catch( \Exception )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a string with the event date/times in the timezone of the user who created the event
|
||||
@@ -2304,8 +2326,11 @@ class _Event extends \IPS\Content\Item implements
|
||||
public function hasPassed()
|
||||
{
|
||||
// Get the end date. If none is available use the start date plus an hour so that online event join links show for a short while after the start
|
||||
$lastOccurrence = $this->lastOccurrence( 'endDate' ) ?? $this->lastOccurrence( 'startDate' )->add( new \DateInterval("PT1H") );
|
||||
if ( $lastOccurrence < \IPS\DateTime::ts( time() ) )
|
||||
$lastOccurrence = $this->lastOccurrence( 'endDate' ) ?? $this->lastOccurrence( 'startDate' );
|
||||
|
||||
$lastOccurrenceClone = clone $lastOccurrence;
|
||||
$lastOccurrenceClone = $lastOccurrenceClone->add( new \DateInterval("PT1H") );
|
||||
if ( $lastOccurrenceClone < \IPS\DateTime::ts( time() ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user