Version 4.7.8
This commit is contained in:
1 parent
7b7404e741
commit
fd22d99e69
688 files changed
+19814
-10890
No files matched your search
@@ -704,7 +704,28 @@ class _Stream extends \IPS\Node\Model
|
||||
}
|
||||
|
||||
/* And dates */
|
||||
if ( isset( $values['stream_date_type'] ) && $values['stream_date_type'] )
|
||||
if ( isset( $values['stream_date_type'] ) )
|
||||
{
|
||||
/* If we're using last visit or relative, we need to reset some values. */
|
||||
try
|
||||
{
|
||||
match( $values['stream_date_type'] ) {
|
||||
'last_visit' => [
|
||||
$values['stream_date_start'] = NULL,
|
||||
$values['stream_date_end'] = NULL,
|
||||
$values['stream_date_relative_days'] = NULL,
|
||||
],
|
||||
'relative' => [
|
||||
$values['stream_date_start'] = NULL,
|
||||
$values['stream_date_end'] = NULL,
|
||||
]
|
||||
};
|
||||
}
|
||||
catch( \UnhandledMatchError ) { }
|
||||
}
|
||||
|
||||
/* If we're using custom dates, these need to be handled specially. */
|
||||
if ( isset( $values['stream_date_type'] ) AND $values['stream_date_type'] AND $values['stream_date_type'] === 'custom' )
|
||||
{
|
||||
if ( ! isset( $values['stream_date_start'] ) )
|
||||
{
|
||||
@@ -715,6 +736,8 @@ class _Stream extends \IPS\Node\Model
|
||||
{
|
||||
$values['stream_date_end'] = isset( $values['stream_date_range'] ) && $values['stream_date_range']['end'] ? ( $values['stream_date_range']['end'] instanceof \IPS\DateTime ? $values['stream_date_range']['end']->getTimestamp() : $values['stream_date_range']['end'] ) : NULL;
|
||||
}
|
||||
|
||||
$values['stream_date_relative_days'] = NULL;
|
||||
}
|
||||
|
||||
unset( $values['stream_date_range'] );
|
||||
|
||||
Reference in new issue
Block a user