fixed date search

This commit is contained in:
csoler 2023-01-17 20:00:55 +01:00
parent 41317b6fe3
commit 6a28727e76

View File

@ -150,11 +150,24 @@ RsRegularExpression::Expression* ExpressionWidget::getRsExpression()
wordList); wordList);
break; break;
case DateSearch: case DateSearch:
if (inRangedConfig) { switch(exprCondElem->getRelOperator()) // we need to convert expressions so that the delta is 1 day (i.e. 86400 secs)
expr = new RsRegularExpression::DateExpression(exprCondElem->getRelOperator(), checkedConversion(lowVal), checkedConversion(highVal)); {
} else { case RsRegularExpression::Equals:
expr = new RsRegularExpression::DateExpression(RsRegularExpression::InRange, checkedConversion(exprParamElem->getIntValue()), checkedConversion(86400+exprParamElem->getIntValue()));
break;
case RsRegularExpression::InRange:
expr = new RsRegularExpression::DateExpression(exprCondElem->getRelOperator(), checkedConversion(lowVal), 86400+checkedConversion(highVal));
break;
case RsRegularExpression::Greater: // fallthrough
case RsRegularExpression::SmallerEquals:
expr = new RsRegularExpression::DateExpression(exprCondElem->getRelOperator(), checkedConversion(exprParamElem->getIntValue()+86400));
break;
default:
case RsRegularExpression::GreaterEquals: // fallthrough
case RsRegularExpression::Smaller:
expr = new RsRegularExpression::DateExpression(exprCondElem->getRelOperator(), checkedConversion(exprParamElem->getIntValue())); expr = new RsRegularExpression::DateExpression(exprCondElem->getRelOperator(), checkedConversion(exprParamElem->getIntValue()));
} break;
}
break; break;
case PopSearch: case PopSearch:
if (inRangedConfig) { if (inRangedConfig) {