mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 Improve database date field filtering https://github.com/siyuan-note/siyuan/issues/15744
This commit is contained in:
parent
a26c72d293
commit
a5d268665d
1 changed files with 3 additions and 3 deletions
|
|
@ -538,17 +538,17 @@ func filterRelativeTime(valueMills int64, valueIsNotEmpty bool, operator FilterO
|
||||||
|
|
||||||
switch operator {
|
switch operator {
|
||||||
case FilterOperatorIsEqual:
|
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:
|
case FilterOperatorIsNotEqual:
|
||||||
return valueTime.Before(otherValueStart) || valueTime.After(otherValueEnd)
|
return valueTime.Before(otherValueStart) || valueTime.After(otherValueEnd)
|
||||||
case FilterOperatorIsGreater:
|
case FilterOperatorIsGreater:
|
||||||
return valueTime.After(otherValueStart)
|
return valueTime.After(otherValueEnd)
|
||||||
case FilterOperatorIsGreaterOrEqual:
|
case FilterOperatorIsGreaterOrEqual:
|
||||||
return valueTime.After(otherValueStart) || valueTime.Equal(otherValueStart)
|
return valueTime.After(otherValueStart) || valueTime.Equal(otherValueStart)
|
||||||
case FilterOperatorIsLess:
|
case FilterOperatorIsLess:
|
||||||
return valueTime.Before(otherValueStart)
|
return valueTime.Before(otherValueStart)
|
||||||
case FilterOperatorIsLessOrEqual:
|
case FilterOperatorIsLessOrEqual:
|
||||||
return valueTime.Before(otherValueStart) || valueTime.Equal(otherValueStart)
|
return valueTime.Before(otherValueEnd) || valueTime.Equal(otherValueEnd)
|
||||||
case FilterOperatorIsBetween:
|
case FilterOperatorIsBetween:
|
||||||
if RelativeDateDirectionBefore == direction {
|
if RelativeDateDirectionBefore == direction {
|
||||||
if RelativeDateDirectionBefore == direction2 {
|
if RelativeDateDirectionBefore == direction2 {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue