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 () { ...@@ -4045,7 +4045,7 @@ cSQRTPI.prototype.getInfo = function () {
} else { } else {
search = arg1; search = arg1;
} }
valueForSearching = AscCommonExcel.parseNum(search) ? new cNumber(search) : new cString(search); valueForSearching = AscCommonExcel.matchingValue(search);
if (cElementType.cellsRange === arg0.type) { if (cElementType.cellsRange === arg0.type) {
var arg0Matrix = arg0.getMatrix(), arg2Matrix = arg2.getMatrix(), valMatrix2; var arg0Matrix = arg0.getMatrix(), arg2Matrix = arg2.getMatrix(), valMatrix2;
for (var i = 0; i < arg0Matrix.length; i++) { for (var i = 0; i < arg0Matrix.length; i++) {
...@@ -4138,7 +4138,7 @@ cSQRTPI.prototype.getInfo = function () { ...@@ -4138,7 +4138,7 @@ cSQRTPI.prototype.getInfo = function () {
search = arg2; search = arg2;
oper = null; oper = null;
} }
valueForSearching = AscCommonExcel.parseNum(search) ? new cNumber(search) : new cString(search); valueForSearching = AscCommonExcel.matchingValue(search);
var arg1Matrix = arg1.getMatrix(); var arg1Matrix = arg1.getMatrix();
if (arg0Matrix.length !== arg1Matrix.length) { if (arg0Matrix.length !== arg1Matrix.length) {
......
...@@ -5364,6 +5364,10 @@ function parseNum( str ) { ...@@ -5364,6 +5364,10 @@ function parseNum( str ) {
return !isNaN( 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) { function matching(x, y, operator) {
var res = false, rS; var res = false, rS;
if (cElementType.string === y.type) { if (cElementType.string === y.type) {
...@@ -5673,6 +5677,7 @@ function rtl_math_erfc( x ) { ...@@ -5673,6 +5677,7 @@ function rtl_math_erfc( x ) {
window['AscCommonExcel'].parseNum = parseNum; window['AscCommonExcel'].parseNum = parseNum;
window['AscCommonExcel'].matching = matching; window['AscCommonExcel'].matching = matching;
window['AscCommonExcel'].matchingValue = matchingValue;
window['AscCommonExcel'].GetDiffDate360 = GetDiffDate360; window['AscCommonExcel'].GetDiffDate360 = GetDiffDate360;
window['AscCommonExcel'].searchRegExp2 = searchRegExp2; window['AscCommonExcel'].searchRegExp2 = searchRegExp2;
window['AscCommonExcel'].rtl_math_erf = rtl_math_erf; window['AscCommonExcel'].rtl_math_erf = rtl_math_erf;
......
...@@ -588,7 +588,7 @@ ...@@ -588,7 +588,7 @@
} else { } else {
search = arg1; search = arg1;
} }
valueForSearching = parseNum(search) ? new cNumber(search) : new cString(search); valueForSearching = AscCommonExcel.matchingValue(search);
if (cElementType.cellsRange === arg0.type) { if (cElementType.cellsRange === arg0.type) {
ws = arg0.getWS(); ws = arg0.getWS();
var tmpCellArg0 = arg0.getRange().getCells()[0], tmpCellArg2 = arg2.getRange(), offset, bbox, r2; var tmpCellArg0 = arg0.getRange().getCells()[0], tmpCellArg2 = arg2.getRange(), offset, bbox, r2;
...@@ -1104,7 +1104,7 @@ ...@@ -1104,7 +1104,7 @@
} else { } else {
search = arg1; search = arg1;
} }
valueForSearching = parseNum(search) ? new cNumber(search) : new cString(search); valueForSearching = AscCommonExcel.matchingValue(search);
if (cElementType.cellsRange === arg0.type) { if (cElementType.cellsRange === arg0.type) {
arg0.foreach2(function (_val) { arg0.foreach2(function (_val) {
_count += matching(_val, valueForSearching, oper); _count += matching(_val, valueForSearching, oper);
...@@ -1173,7 +1173,7 @@ ...@@ -1173,7 +1173,7 @@
} else { } else {
search = arg1; search = arg1;
} }
valueForSearching = parseNum(search) ? new cNumber(search) : new cString(search); valueForSearching = AscCommonExcel.matchingValue(search);
arg1Matrix = arg0.getMatrix(); arg1Matrix = arg0.getMatrix();
if (!arg0Matrix) { if (!arg0Matrix) {
arg0Matrix = arg1Matrix; 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