Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

+29 -4
View File
@@ -99,8 +99,33 @@ class _Date extends \IPS\DateTime
if ( $offset === NULL and \IPS\Member::loggedIn()->timezone )
{
$timezone = \IPS\DateTime::create();
$timezone->setTimezone( new \DateTimeZone( \IPS\Member::loggedIn()->timezone ) );
$timezone = \IPS\DateTime::create();
$validTimezone = TRUE;
if( \in_array( \IPS\Member::loggedIn()->timezone, static::getTimezoneIdentifiers() ) )
{
try
{
$timezone->setTimezone( new \DateTimeZone( \IPS\Member::loggedIn()->timezone ) );
}
catch ( \Exception $e )
{
$validTimezone = FALSE;
}
}
else
{
$validTimezone = FALSE;
}
if( ! $validTimezone )
{
\IPS\Member::loggedIn()->timezone = null;
if ( \IPS\Member::loggedIn()->member_id )
{
\IPS\Member::loggedIn()->save();
}
}
$offset = $timezone->getOffset();
}
@@ -552,11 +577,11 @@ class _Date extends \IPS\DateTime
{
if( $includeTime )
{
return date( 'Y-m-d H:i:s', isset( $this->dateInformation[0] ) ? $this->dateInformation[0] : $this->getTimestamp() );
return $this->dateInformation['year'] . '-' . str_pad( $this->dateInformation['mon'], 2, 0, STR_PAD_LEFT ) . '-' . str_pad( $this->dateInformation['mday'], 2, 0, STR_PAD_LEFT ) . ' ' . str_pad( $this->dateInformation['hours'], 2, 0, STR_PAD_LEFT ) . ':' . str_pad( $this->dateInformation['minutes'], 2, 0, STR_PAD_LEFT ) . ':' . str_pad( $this->dateInformation['seconds'], 2, 0, STR_PAD_LEFT );
}
else
{
return date( 'Y-m-d', isset( $this->dateInformation[0] ) ? $this->dateInformation[0] : $this->getTimestamp() );
return $this->dateInformation['year'] . '-' . str_pad( $this->dateInformation['mon'], 2, 0, STR_PAD_LEFT ) . '-' . str_pad( $this->dateInformation['mday'], 2, 0, STR_PAD_LEFT );
}
}