From a5d268665d8fa99c96c0b4cbcef7160349363785 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 3 Sep 2025 08:56:30 +0800 Subject: [PATCH] :art: Improve database date field filtering https://github.com/siyuan-note/siyuan/issues/15744 --- kernel/av/filter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/av/filter.go b/kernel/av/filter.go index 85fe1931f..ac462deb5 100644 --- a/kernel/av/filter.go +++ b/kernel/av/filter.go @@ -538,17 +538,17 @@ func filterRelativeTime(valueMills int64, valueIsNotEmpty bool, operator FilterO switch operator { case FilterOperatorIsEqual: - return (valueTime.After(otherValueStart) || valueTime.Equal(otherValueStart)) && valueTime.Before(otherValueEnd) + return (valueTime.After(otherValueStart) || valueTime.Equal(otherValueStart)) && (valueTime.Before(otherValueEnd) || valueTime.Equal(otherValueEnd)) case FilterOperatorIsNotEqual: return valueTime.Before(otherValueStart) || valueTime.After(otherValueEnd) case FilterOperatorIsGreater: - return valueTime.After(otherValueStart) + return valueTime.After(otherValueEnd) case FilterOperatorIsGreaterOrEqual: return valueTime.After(otherValueStart) || valueTime.Equal(otherValueStart) case FilterOperatorIsLess: return valueTime.Before(otherValueStart) case FilterOperatorIsLessOrEqual: - return valueTime.Before(otherValueStart) || valueTime.Equal(otherValueStart) + return valueTime.Before(otherValueEnd) || valueTime.Equal(otherValueEnd) case FilterOperatorIsBetween: if RelativeDateDirectionBefore == direction { if RelativeDateDirectionBefore == direction2 {