mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server: Fix build comparator preferring numeric comparators
This commit is contained in:
parent
105aa3e5f8
commit
eb39da19b3
@ -33,11 +33,8 @@ const numericComparators: Record<string, Comparator<number>> = {
|
||||
function buildComparator(operator: string, comparedValue: string) {
|
||||
comparedValue = comparedValue.toLowerCase();
|
||||
|
||||
if (operator in numericComparators) {
|
||||
const floatValue = parseFloat(comparedValue);
|
||||
if (!isNaN(floatValue)) {
|
||||
return numericComparators[operator](floatValue);
|
||||
}
|
||||
if (operator in numericComparators && !isNaN(+comparedValue)) {
|
||||
return numericComparators[operator](parseFloat(comparedValue));
|
||||
}
|
||||
|
||||
if (operator in stringComparators) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user