Index: branches/unlabeled/unlabeled-1.4.2/core/units/general/helpers/search_helper.php =================================================================== diff -u -r6849 -r6895 --- branches/unlabeled/unlabeled-1.4.2/core/units/general/helpers/search_helper.php (.../search_helper.php) (revision 6849) +++ branches/unlabeled/unlabeled-1.4.2/core/units/general/helpers/search_helper.php (.../search_helper.php) (revision 6895) @@ -415,9 +415,11 @@ $day_seconds = 23 * 60 * 60 + 59 * 60 + 59; if ($from !== false && $to === false) { + $from = strtotime(date('Y-m-d', $from).' 00:00:00', $from); // reset to morning $to = $from + $day_seconds; } elseif ($from === false && $to !== false) { + $to = strtotime(date('Y-m-d', $to).' 23:59:59', $to); // reset to evening $from = $to - $day_seconds; } @@ -463,19 +465,20 @@ } $lang_current =& $this->Application->recallObject('lang.current'); - $dt_separator = getArrayValue($object->GetFieldOptions($search_field), 'date_time_separator'); - if (!$dt_separator) { - $dt_separator = ' '; - } + $options = $object->GetFieldOptions($search_field); + $dt_separator = isset($options['date_time_separator']) ? $options['date_time_separator'] : ' '; - $time = ($type == 'from') ? adodb_mktime(0, 0, 0) : adodb_mktime(23, 59, 59); - $time = adodb_date($lang_current->GetDBField('InputTimeFormat'), $time); - - $full_value = $value[$type].$dt_separator.$time; + $tmp_value = explode($dt_separator, $value[$type], 2); + if (count($tmp_value) == 1) { + // time is missing, then guess it and add to date + $time = ($type == 'from') ? adodb_mktime(0, 0, 0) : adodb_mktime(23, 59, 59); + $time = adodb_date($lang_current->GetDBField('InputTimeFormat'), $time); + $value[$type] .= $dt_separator.$time; + } $formatter =& $this->Application->recallObject($object->Fields[$search_field]['formatter']); - $value_ts = $formatter->Parse($full_value, $search_field, $object); + $value_ts = $formatter->Parse($value[$type], $search_field, $object); $pseudo = getArrayValue($object->FieldErrors, $search_field, 'pseudo'); if ($pseudo) { unset($object->FieldErrors[$search_field]); // remove error!