# This patch file was generated by NetBeans IDE # This patch can be applied using context Tools: Apply Diff Patch action on respective folder. # It uses platform neutral UTF-8 encoding. # Above lines and this line are ignored by the patching process. --- components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php +++ components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php @@ -1281,6 +1281,13 @@ $minHtml = moscomprofilerHTML::selectList( $choices, $minNam, $additional, 'text', 'value', $minVal, 2 ); $maxHtml = moscomprofilerHTML::selectList( $choices, $maxNam, $additional, 'text', 'value', $maxVal, 2 ); } else { + if ( $minVal !== null ) { + $minVal = date( 'Y-m-d', strtotime( $minVal ) ); + } + if ( $maxVal !== null ) { + $maxVal = date( 'Y-m-d', strtotime( $maxVal ) ); + } + // Search by date range: $minHtml = $calendars->cbAddCalendar( $minNam, _UE_SEARCH_FROM . ' ' . $this->getFieldTitle( $field, $user, 'text', $reason ), false, $minVal, false, false, $yMin, $yMax ); $maxHtml = $calendars->cbAddCalendar( $maxNam, _UE_SEARCH_TO . ' ' . $this->getFieldTitle( $field, $user, 'text', $reason ), false, $maxVal, false, false, $yMin, $yMax ); @@ -1587,19 +1594,19 @@ $maxVal = null; } } else { - $minValIn = $this->_displayDateToSql( stripslashes( cbGetParam( $postdata, $minNam ) ) ); - $maxValIn = $this->_displayDateToSql( stripslashes( cbGetParam( $postdata, $maxNam ) ) ); - $minVal = $minValIn; - $maxVal = $maxValIn; + $minVal = $this->_displayDateToSql( stripslashes( cbGetParam( $postdata, $minNam ) ) ); + $maxVal = $this->_displayDateToSql( stripslashes( cbGetParam( $postdata, $maxNam ) ) ); + $minValIn = cbFormatDate( $minVal ); + $maxValIn = cbFormatDate( $maxVal ); } if ( $minVal && ( $minVal !== '0000-00-00' ) ) { $query[] = $this->_dateToSql( $field, $col, $minVal, '>=', $searchMode ); // Finally store the selected drop-down values so they can be pre-selected on display: - $searchVals->$minNam = cbFormatDate( $minValIn ); + $searchVals->$minNam = $minValIn; if ( ( ! $maxVal ) && $maxValIn ) { - $searchVals->$maxNam = cbFormatDate( $maxValIn ); + $searchVals->$maxNam = $maxValIn; } } @@ -1610,10 +1617,10 @@ } // Finally store the selected drop-down values so they can be pre-selected on display: if ( ( ! $minVal ) && $minValIn ) { - $searchVals->$minNam = cbFormatDate( $minValIn ); + $searchVals->$minNam = $minValIn; } - $searchVals->$maxNam = cbFormatDate( $maxValIn ); + $searchVals->$maxNam = $maxValIn; } } }