Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+14 -6
View File
@@ -2,9 +2,9 @@
/**
* @brief Date input class for Form Builder
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 8 Mar 2013
* @version SVN_VERSION_NUMBER
*/
@@ -161,7 +161,14 @@ class _Date extends FormAbstract
public function formatValue()
{
$v = $this->value;
$timezone = $this->options['timezone'] ?: ( \IPS\Member::loggedIn()->timezone ? new \DateTimeZone( \IPS\Member::loggedIn()->timezone ) : NULL );
try
{
$timezone = $this->options['timezone'] ?: ( \IPS\Member::loggedIn()->timezone ? new \DateTimeZone( \IPS\Member::loggedIn()->timezone ) : NULL );
}
catch ( \Exception $e )
{
$timezone = NULL;
}
if ( $this->options['unlimited'] !== NULL and $v === $this->options['unlimited'] )
{
@@ -231,10 +238,10 @@ class _Date extends FormAbstract
$count = 0;
$bits = array();
foreach ( array( 'dd', 'mm', 'yy' ) as $k )
foreach ( array( 'DD', 'MM', 'YY' ) as $k )
{
$regex = str_replace( $k, '(.+?)', preg_quote( $format, '/' ) );
foreach ( array( 'dd', 'mm', 'yy' ) as $j )
foreach ( array( 'DD', 'MM', 'YY' ) as $j )
{
if ( $k != $j )
{
@@ -245,7 +252,8 @@ class _Date extends FormAbstract
$bits[ $k ] = preg_replace( "/^{$regex}$/", '$1', trim( $date ), 1, $_count );
$count += $_count;
}
return ( $count == 3 ) ? "{$bits['yy']}-{$bits['mm']}-{$bits['dd']}" : $date;
return ( $count == 3 ) ? "{$bits['YY']}-{$bits['MM']}-{$bits['DD']}" : $date;
}
/**