convert dates in custom attributes into propper format before searching

This commit is contained in:
Uwe Steinmann 2021-03-12 10:06:54 +01:00
parent 66917cd156
commit 6ead3fe425

View File

@ -443,6 +443,22 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext
else
$attributes = array();
foreach($attributes as $attrdefid=>$attribute) {
$attrdef = $dms->getAttributeDefinition($attrdefid);
if($attribute) {
if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) {
if(is_array($attribute)) {
if(!empty($attributes[$attrdefid]['from']))
$attributes[$attrdefid]['from'] = date('Y-m-d', makeTsFromDate($attribute['from']));
if(!empty($attributes[$attrdefid]['to']))
$attributes[$attrdefid]['to'] = date('Y-m-d', makeTsFromDate($attribute['to']));
} else {
$attributes[$attrdefid] = date('Y-m-d', makeTsFromDate($attribute));
}
}
}
}
//
// Get the page number to display. If the result set contains more than
// 25 entries, it is displayed across multiple pages.