mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 02:21:38 +08:00
🎨 Support database date field relative to today's filtering https://github.com/siyuan-note/siyuan/issues/10451
This commit is contained in:
parent
7956a60dcc
commit
061380744b
@ -294,7 +294,7 @@ func (value *Value) CompareOperator(filter *ViewFilter, attrView *AttributeView,
|
||||
}
|
||||
|
||||
func (value *Value) compareOperator(filter *ViewFilter) bool {
|
||||
if nil == filter || nil == filter.Value {
|
||||
if nil == filter || (nil == filter.Value && nil == filter.RelativeDate) {
|
||||
return true
|
||||
}
|
||||
|
||||
@ -403,7 +403,6 @@ func (value *Value) compareOperator(filter *ViewFilter) bool {
|
||||
// 计算今天的起始时间
|
||||
relativeTime = time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
|
||||
}
|
||||
|
||||
case RelativeDateUnitWeek:
|
||||
relativeTime = now.AddDate(0, 0, count*7*int(direction))
|
||||
if FilterOperatorIsBetween == operator && RelativeDateDirectionThis == direction {
|
||||
|
Loading…
Reference in New Issue
Block a user