Down to 75 failures. Started at 91.
This commit is contained in:
parent
7e69f85e77
commit
6a2b65b75b
|
@ -320,21 +320,33 @@ export const runQuery = (
|
||||||
|
|
||||||
const rangeMatch = match(
|
const rangeMatch = match(
|
||||||
SearchFilterOperator.RANGE,
|
SearchFilterOperator.RANGE,
|
||||||
(
|
(docValue: any, testValue: any) => {
|
||||||
docValue: string | number | null,
|
|
||||||
testValue: { low: number; high: number }
|
|
||||||
) => {
|
|
||||||
if (docValue == null || docValue === "") {
|
if (docValue == null || docValue === "") {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if (testValue.low == null && testValue.high == null) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
if (!isNaN(+docValue)) {
|
if (!isNaN(+docValue)) {
|
||||||
return +docValue >= testValue.low || +docValue <= testValue.high
|
if (!isNaN(+testValue.low) && !isNaN(+testValue.high)) {
|
||||||
|
return +docValue >= testValue.low && +docValue <= testValue.high
|
||||||
|
} else if (!isNaN(+testValue.low)) {
|
||||||
|
return +docValue >= testValue.low
|
||||||
|
} else if (!isNaN(+testValue.high)) {
|
||||||
|
return +docValue <= testValue.high
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (dayjs(docValue).isValid()) {
|
if (dayjs(docValue).isValid()) {
|
||||||
return (
|
if (dayjs(testValue.low).isValid() && dayjs(testValue.high).isValid()) {
|
||||||
new Date(docValue).getTime() >= new Date(testValue.low).getTime() ||
|
return (
|
||||||
new Date(docValue).getTime() <= new Date(testValue.high).getTime()
|
dayjs(docValue).isAfter(testValue.low) &&
|
||||||
)
|
dayjs(docValue).isBefore(testValue.high)
|
||||||
|
)
|
||||||
|
} else if (dayjs(testValue.low).isValid()) {
|
||||||
|
return dayjs(docValue).isAfter(testValue.low)
|
||||||
|
} else if (dayjs(testValue.high).isValid()) {
|
||||||
|
return dayjs(docValue).isBefore(testValue.high)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -422,6 +434,10 @@ export const runQuery = (
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (testValue.length === 0) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
return testValue[f](item => _valueMatches(docValue, item))
|
return testValue[f](item => _valueMatches(docValue, item))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue