marcusolsson/obsidian-projects

Filter for greater/less zero always gives empty result

st4ng opened this issue · 0 comments

What happened?

Filtering a number field for greater/less zero always gives an empty result, even though there should be matches for the condition.

What did you expect to happen?

The correct records should be shown.

How can we reproduce it (as minimally and precisely as possible)?

Have a record with a number field larger than zero and apply filter ">0".

Anything else we need to know?

Fix should be as easy as changing all the number filter functions from
lt: (left, right) => (left && right ? left < right : false),
to
lt: (left, right) => isNumber(left) && isNumber(right) && left < right

I will open a PR.

Plugin version

1.17.1

Obsidian version

1.5.3

OS

Windows