@optimiser/common 1.0.272 → 1.0.273
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/utility.js +19 -23
- package/package.json +1 -1
package/dist/lib/utility.js
CHANGED
|
@@ -2106,9 +2106,9 @@ function FilterConditions(condition, match, fields) {
|
|
|
2106
2106
|
else if (field.Schema.SearchType == 'dropdown') {
|
|
2107
2107
|
matchValue = { '$eq': obj.Value };
|
|
2108
2108
|
}
|
|
2109
|
-
else if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2110
|
-
|
|
2111
|
-
}
|
|
2109
|
+
// else if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2110
|
+
// matchValue = { '$gte': moment(obj.Value).startOf('day').toDate(), '$lte': moment(obj.Value).endOf('day').toDate() };
|
|
2111
|
+
// }
|
|
2112
2112
|
else if (["int", "decimal", "percent"].includes(field.Schema.UIDataType)) {
|
|
2113
2113
|
matchValue = { '$eq': obj.Value };
|
|
2114
2114
|
}
|
|
@@ -2146,33 +2146,29 @@ function FilterConditions(condition, match, fields) {
|
|
|
2146
2146
|
break;
|
|
2147
2147
|
case "GREATER_THAN":
|
|
2148
2148
|
if (obj.Value) {
|
|
2149
|
-
if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2150
|
-
|
|
2151
|
-
}
|
|
2152
|
-
|
|
2153
|
-
matchValue = { '$gt': obj.Value };
|
|
2149
|
+
// if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2150
|
+
// matchValue = { '$gt': moment(obj.Value).endOf('day').toDate() };
|
|
2151
|
+
// } else
|
|
2152
|
+
matchValue = { '$gt': obj.Value };
|
|
2154
2153
|
}
|
|
2155
2154
|
break;
|
|
2156
2155
|
case "LESS_THAN":
|
|
2157
|
-
if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2158
|
-
|
|
2159
|
-
}
|
|
2160
|
-
|
|
2161
|
-
matchValue = { '$lt': obj.Value };
|
|
2156
|
+
// if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2157
|
+
// matchValue = { '$lt': moment(obj.Value).startOf('day').toDate() }
|
|
2158
|
+
// } else
|
|
2159
|
+
matchValue = { '$lt': obj.Value };
|
|
2162
2160
|
break;
|
|
2163
2161
|
case "GREATER_OR_EQUAL":
|
|
2164
|
-
if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2165
|
-
|
|
2166
|
-
}
|
|
2167
|
-
|
|
2168
|
-
matchValue = { '$gte': obj.Value };
|
|
2162
|
+
// if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2163
|
+
// matchValue = { '$gte': moment(obj.Value).startOf('day').toDate() }
|
|
2164
|
+
// } else
|
|
2165
|
+
matchValue = { '$gte': obj.Value };
|
|
2169
2166
|
break;
|
|
2170
2167
|
case "LESS_OR_EQUAL":
|
|
2171
|
-
if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2172
|
-
|
|
2173
|
-
}
|
|
2174
|
-
|
|
2175
|
-
matchValue = { '$lte': obj.Value };
|
|
2168
|
+
// if (["date", "datetime"].includes(field.Schema.UIDataType)) {
|
|
2169
|
+
// matchValue = { '$lte': moment(obj.Value).endOf('day').toDate() }
|
|
2170
|
+
// } else
|
|
2171
|
+
matchValue = { '$lte': obj.Value };
|
|
2176
2172
|
break;
|
|
2177
2173
|
case "STARTS_WITH":
|
|
2178
2174
|
matchValue = { '$regex': '^' + obj.Value, '$options': 'i' };
|