🎨 Add the custom-dailynote-yyyyMMdd attribute when creating a dailynote doc https://github.com/siyuan-note/siyuan/issues/9807

This commit is contained in:
Daniel 2023-12-04 16:05:43 +08:00
parent 5c5f7da1e6
commit 773a6f5ec2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -1119,8 +1119,21 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) {
} }
IncSync() IncSync()
b := treenode.GetBlockTree(id) WaitForWritingFiles()
p = b.Path
tree, err := loadTreeByBlockID(id)
if nil != err {
logging.LogErrorf("load tree by block id [%s] failed: %v", id, err)
return
}
p = tree.Path
date := util.TimeFromID(id)
date = date[:len("yyyyMMdd")]
tree.Root.SetIALAttr("custom-dailynote-"+date, date)
if err = indexWriteJSONQueue(tree); nil != err {
return
}
return return
} }