mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/15593
This commit is contained in:
parent
35de72f64d
commit
4598e3237b
2 changed files with 22 additions and 3 deletions
|
|
@ -874,15 +874,27 @@ func (filter *ViewFilter) GetAffectValue(key *Key, addingBlockID string) (ret *V
|
|||
case FilterOperatorIsNotEqual:
|
||||
ret.Date = &ValueDate{Content: util.CurrentTimeMillis(), IsNotEmpty: true}
|
||||
case FilterOperatorIsGreater:
|
||||
ret.Date = &ValueDate{Content: filter.Value.Date.Content + 1000*60, IsNotEmpty: true}
|
||||
ret.Date = &ValueDate{Content: filter.Value.Date.Content + 1000*60*60*24, IsNotEmpty: true}
|
||||
case FilterOperatorIsGreaterOrEqual:
|
||||
ret.Date = &ValueDate{Content: filter.Value.Date.Content, IsNotEmpty: true}
|
||||
case FilterOperatorIsLess:
|
||||
ret.Date = &ValueDate{Content: filter.Value.Date.Content - 1000*60, IsNotEmpty: true}
|
||||
ret.Date = &ValueDate{Content: filter.Value.Date.Content - 1000*60*60*24, IsNotEmpty: true}
|
||||
case FilterOperatorIsLessOrEqual:
|
||||
ret.Date = &ValueDate{Content: filter.Value.Date.Content, IsNotEmpty: true}
|
||||
case FilterOperatorIsBetween:
|
||||
ret.Date = &ValueDate{Content: filter.Value.Date.Content - 1000*60, IsNotEmpty: true}
|
||||
start := filter.Value.Date.Content
|
||||
end := filter.Value.Date.Content2
|
||||
if start > end {
|
||||
tmp := end
|
||||
end = start
|
||||
start = tmp
|
||||
}
|
||||
now := util.CurrentTimeMillis()
|
||||
if start <= now && now <= end {
|
||||
ret.Date = &ValueDate{Content: now, IsNotEmpty: true}
|
||||
return
|
||||
}
|
||||
ret.Date = &ValueDate{Content: start, IsNotEmpty: true}
|
||||
case FilterOperatorIsEmpty:
|
||||
ret.Date = &ValueDate{Content: 0, IsNotEmpty: false}
|
||||
case FilterOperatorIsNotEmpty:
|
||||
|
|
|
|||
|
|
@ -148,6 +148,13 @@ func getAttrViewAddingBlockDefaultValues(attrView *av.AttributeView, view, group
|
|||
newValue = getNewValueByNearItem(nearItem, keyValues.Key, addingItemID)
|
||||
}
|
||||
if nil != newValue {
|
||||
if av.KeyTypeDate == keyValues.Key.Type {
|
||||
if nil != nearItem {
|
||||
nearValue := getNewValueByNearItem(nearItem, keyValues.Key, addingItemID)
|
||||
newValue.Date.IsNotTime = nearValue.Date.IsNotTime
|
||||
}
|
||||
}
|
||||
|
||||
ret[keyValues.Key.ID] = newValue
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue