mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/15529
This commit is contained in:
parent
dc39e18fc1
commit
68af39ba48
1 changed files with 16 additions and 1 deletions
|
|
@ -434,7 +434,19 @@ func fillAttributeViewAutoGeneratedValues(attrView *av.AttributeView, collection
|
||||||
keyValues = append(keyValues, &av.KeyValues{Key: relKey, Values: []*av.Value{{ID: value.ID, KeyID: relKey.ID, BlockID: itemID, Type: av.KeyTypeRelation, Relation: value.Relation}}})
|
keyValues = append(keyValues, &av.KeyValues{Key: relKey, Values: []*av.Value{{ID: value.ID, KeyID: relKey.ID, BlockID: itemID, Type: av.KeyTypeRelation, Relation: value.Relation}}})
|
||||||
items[itemID] = keyValues
|
items[itemID] = keyValues
|
||||||
case av.KeyTypeCreated: // 渲染创建时间
|
case av.KeyTypeCreated: // 渲染创建时间
|
||||||
createdStr := itemID[:len("20060102150405")]
|
ial := map[string]string{}
|
||||||
|
block := item.GetBlockValue()
|
||||||
|
if nil != block {
|
||||||
|
ial = ials[block.Block.ID]
|
||||||
|
}
|
||||||
|
if nil == ial {
|
||||||
|
ial = map[string]string{}
|
||||||
|
}
|
||||||
|
id := itemID
|
||||||
|
if "" != ial["id"] {
|
||||||
|
id = ial["id"]
|
||||||
|
}
|
||||||
|
createdStr := id[:len("20060102150405")]
|
||||||
created, parseErr := time.ParseInLocation("20060102150405", createdStr, time.Local)
|
created, parseErr := time.ParseInLocation("20060102150405", createdStr, time.Local)
|
||||||
if nil == parseErr {
|
if nil == parseErr {
|
||||||
value.Created = av.NewFormattedValueCreated(created.UnixMilli(), 0, av.CreatedFormatNone)
|
value.Created = av.NewFormattedValueCreated(created.UnixMilli(), 0, av.CreatedFormatNone)
|
||||||
|
|
@ -453,6 +465,9 @@ func fillAttributeViewAutoGeneratedValues(attrView *av.AttributeView, collection
|
||||||
if nil != block {
|
if nil != block {
|
||||||
ial = ials[block.Block.ID]
|
ial = ials[block.Block.ID]
|
||||||
}
|
}
|
||||||
|
if nil == ial {
|
||||||
|
ial = map[string]string{}
|
||||||
|
}
|
||||||
updatedStr := ial["updated"]
|
updatedStr := ial["updated"]
|
||||||
if "" == updatedStr && nil != block {
|
if "" == updatedStr && nil != block {
|
||||||
value.Updated = av.NewFormattedValueUpdated(block.Block.Updated, 0, av.UpdatedFormatNone)
|
value.Updated = av.NewFormattedValueUpdated(block.Block.Updated, 0, av.UpdatedFormatNone)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue