PDA

View Full Version : Problem with listing Field Type "Date"



PGGO
July 12, 2012, 11:47 PM
I notice a problem with listing Field Type “Date”
When user adds new listing and left this field empty, the system always display “Nov 30, 1999”

Vladimir
July 13, 2012, 03:43 AM
Hello,

you can fix the problem in the following way:

- open the file includes/classess/rlCommon.class.php
- go to method adapt()
_ find this code:


....
if ( $field['Default'] == 'single' )
{
list( $d_year, $d_month, $d_day ) = explode( '-', $value );
$d_timestamp = mktime( 0, 0, 0, $d_month, $d_day, $d_year );
if ( $d_timestamp <= 943920000 )
{
return false;
}
$out = date( str_replace( array( '%', 'b' ), array( '', 'M' ), RL_DATE_FORMAT ), $d_timestamp );
}
....


and change to:


....
if ( $field['Default'] == 'single' )
{
if($value != '0000-00-00 00:00:00' && $value != '0000-00-00')
{
list( $d_year, $d_month, $d_day ) = explode( '-', $value );
$d_timestamp = mktime( 0, 0, 0, $d_month, $d_day, $d_year );
if ( $d_timestamp <= 943920000 )
{
return false;
}
$out = date( str_replace( array( '%', 'b' ), array( '', 'M' ), RL_DATE_FORMAT ), $d_timestamp );
}
}
....

John
July 25, 2012, 11:05 AM
Hello PGGO,
I checked this bug in the Flynax 4.1 beta and didn't find such problem in the version,
looks like we fixed it in new version :)

John