Version 4.7.8
This commit is contained in:
1 parent
7b7404e741
commit
fd22d99e69
688 files changed
+19814
-10890
No files matched your search
@@ -290,15 +290,35 @@ class _Date extends FormAbstract
|
||||
}
|
||||
|
||||
/* Check minimum */
|
||||
|
||||
try
|
||||
{
|
||||
$timezone = $this->options['timezone'] ?: ( \IPS\Member::loggedIn()->timezone ? new \DateTimeZone( \IPS\Member::loggedIn()->timezone ) : NULL );
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
$timezone = NULL;
|
||||
}
|
||||
|
||||
if ( $this->value and $this->options['min'] !== NULL and $this->options['min'] > $this->value )
|
||||
{
|
||||
throw new \LengthException( \IPS\Member::loggedIn()->language()->addToStack('form_date_min', FALSE, array( 'sprintf' => array( $this->options['min']->localeDate() ) ) ) );
|
||||
$string = $this->options['min']->setTimeZone( $timezone )->localeDate( \IPS\Member::loggedIn() );
|
||||
if( $this->options['time'] )
|
||||
{
|
||||
$string .=' ' . $this->options['min']->setTimeZone( $timezone )->localeTime( \IPS\Member::loggedIn() );
|
||||
}
|
||||
throw new \LengthException( \IPS\Member::loggedIn()->language()->addToStack('form_date_min', FALSE, array( 'sprintf' => array( $string ) ) ) );
|
||||
}
|
||||
|
||||
/* Check maximum */
|
||||
if ( $this->value and $this->options['max'] !== NULL and $this->options['max'] < $this->value )
|
||||
{
|
||||
throw new \LengthException( \IPS\Member::loggedIn()->language()->addToStack('form_date_max', FALSE, array( 'sprintf' => array( $this->options['max']->localeDate() ) ) ) );
|
||||
$string = $this->options['max']->setTimeZone( $timezone )->localeDate( \IPS\Member::loggedIn() );
|
||||
if( $this->options['time'] )
|
||||
{
|
||||
$string .=' ' . $this->options['max']->setTimeZone( $timezone )->localeTime( \IPS\Member::loggedIn() );
|
||||
}
|
||||
throw new \LengthException( \IPS\Member::loggedIn()->language()->addToStack('form_date_max', FALSE, array( 'sprintf' => array( $string ) ) ) );
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
||||
Reference in new issue
Block a user