mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
Advanced search: fix date time i18n and 1 second/day add/remove on > and <
SVN:trunk[5781]
This commit is contained in:
@@ -527,16 +527,18 @@ class CriterionToSearchForm extends CriterionConversionAbstract
|
||||
if ($sWidget == AttributeDefinition::SEARCH_WIDGET_TYPE_DATE)
|
||||
{
|
||||
$sDelta = '1 day';
|
||||
$sAttributeClass = AttributeDate::class;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sDelta = '1 second';
|
||||
$sAttributeClass = AttributeDateTime::class;
|
||||
}
|
||||
$oFormat = AttributeDate::GetFormat();
|
||||
$oFormat = $sAttributeClass::GetFormat();
|
||||
$sFirstDate = $aCriterion['values'][0]['value'];
|
||||
$oDate = new DateTime($sFirstDate);
|
||||
$oDate->add(DateInterval::createFromDateString($sDelta));
|
||||
$sFirstDateValue = $oDate->format(AttributeDate::GetSQLFormat());
|
||||
$sFirstDateValue = $oDate->format($sAttributeClass::GetSQLFormat());
|
||||
try
|
||||
{
|
||||
$sFirstDateLabel = $oFormat->format($oDate);
|
||||
@@ -550,16 +552,18 @@ class CriterionToSearchForm extends CriterionConversionAbstract
|
||||
if ($sWidget == AttributeDefinition::SEARCH_WIDGET_TYPE_DATE)
|
||||
{
|
||||
$sDelta = '1 day';
|
||||
$sAttributeClass = AttributeDate::class;
|
||||
}
|
||||
else
|
||||
{
|
||||
$sDelta = '1 second';
|
||||
$sAttributeClass = AttributeDateTime::class;
|
||||
}
|
||||
$oFormat = AttributeDate::GetFormat();
|
||||
$oFormat = $sAttributeClass::GetFormat();
|
||||
$sFirstDate = $aCriterion['values'][0]['value'];
|
||||
$oDate = new DateTime($sFirstDate);
|
||||
$oDate->sub(DateInterval::createFromDateString($sDelta));
|
||||
$sFirstDateValue = $oDate->format(AttributeDate::GetSQLFormat());
|
||||
$sFirstDateValue = $oDate->format($sAttributeClass::GetSQLFormat());
|
||||
try
|
||||
{
|
||||
$sFirstDateLabel = $oFormat->format($oDate);
|
||||
|
||||
Reference in New Issue
Block a user