Commit 5880c0cd authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix date matching in logical criterias

parent ff3d7eca
......@@ -4045,7 +4045,7 @@ cSQRTPI.prototype.getInfo = function () {
} else {
search = arg1;
}
valueForSearching = AscCommonExcel.parseNum(search) ? new cNumber(search) : new cString(search);
valueForSearching = AscCommonExcel.matchingValue(search);
if (cElementType.cellsRange === arg0.type) {
var arg0Matrix = arg0.getMatrix(), arg2Matrix = arg2.getMatrix(), valMatrix2;
for (var i = 0; i < arg0Matrix.length; i++) {
......@@ -4138,7 +4138,7 @@ cSQRTPI.prototype.getInfo = function () {
search = arg2;
oper = null;
}
valueForSearching = AscCommonExcel.parseNum(search) ? new cNumber(search) : new cString(search);
valueForSearching = AscCommonExcel.matchingValue(search);
var arg1Matrix = arg1.getMatrix();
if (arg0Matrix.length !== arg1Matrix.length) {
......
......@@ -5364,6 +5364,10 @@ function parseNum( str ) {
return !isNaN( str );
}
function matchingValue(search) {
var parseRes = AscCommon.g_oFormatParser.parse(search);
return parseRes ? new cNumber(parseRes.value) : new cString(search);
}
function matching(x, y, operator) {
var res = false, rS;
if (cElementType.string === y.type) {
......@@ -5673,6 +5677,7 @@ function rtl_math_erfc( x ) {
window['AscCommonExcel'].parseNum = parseNum;
window['AscCommonExcel'].matching = matching;
window['AscCommonExcel'].matchingValue = matchingValue;
window['AscCommonExcel'].GetDiffDate360 = GetDiffDate360;
window['AscCommonExcel'].searchRegExp2 = searchRegExp2;
window['AscCommonExcel'].rtl_math_erf = rtl_math_erf;
......
......@@ -588,7 +588,7 @@
} else {
search = arg1;
}
valueForSearching = parseNum(search) ? new cNumber(search) : new cString(search);
valueForSearching = AscCommonExcel.matchingValue(search);
if (cElementType.cellsRange === arg0.type) {
ws = arg0.getWS();
var tmpCellArg0 = arg0.getRange().getCells()[0], tmpCellArg2 = arg2.getRange(), offset, bbox, r2;
......@@ -1104,7 +1104,7 @@
} else {
search = arg1;
}
valueForSearching = parseNum(search) ? new cNumber(search) : new cString(search);
valueForSearching = AscCommonExcel.matchingValue(search);
if (cElementType.cellsRange === arg0.type) {
arg0.foreach2(function (_val) {
_count += matching(_val, valueForSearching, oper);
......@@ -1173,7 +1173,7 @@
} else {
search = arg1;
}
valueForSearching = parseNum(search) ? new cNumber(search) : new cString(search);
valueForSearching = AscCommonExcel.matchingValue(search);
arg1Matrix = arg0.getMatrix();
if (!arg0Matrix) {
arg0Matrix = arg1Matrix;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment