Advanced Search: Dates between

SVN:b1162[5508]
This commit is contained in:
Eric Espié
2018-03-23 13:55:44 +00:00
parent 965e7b48df
commit b0332b6ef5
2 changed files with 12 additions and 3 deletions

View File

@@ -360,12 +360,17 @@ class CriterionToSearchForm extends CriterionConversionAbstract
$sDate = $aCriteria['values'][0]['value'];
$oDate = new DateTime($sDate);
$sFirstDateValue = $oDate->format(AttributeDateTime::GetSQLFormat());
$sFirstDateLabel = AttributeDateTime::GetFormat()->Format($sFirstDateValue);
$aCriteria['values'][0] = array('value' => $sFirstDateValue, 'label' => $sFirstDateLabel);
$oDate->add(DateInterval::createFromDateString('1 day'));
$oDate->sub(DateInterval::createFromDateString('1 second'));
$sLastDate = $oDate->format(AttributeDateTime::GetSQLFormat());
$sLastDate = AttributeDateTime::GetFormat()->Format($sLastDate);
$aCriteria['values'][1] = array('value' => $sLastDate, 'label' => $sLastDate);
$sLastDateValue = $oDate->format(AttributeDateTime::GetSQLFormat());
$sLastDateLabel = AttributeDateTime::GetFormat()->Format($sLastDateValue);
$aCriteria['values'][1] = array('value' => $sLastDateValue, 'label' => $sLastDateLabel);
}
}