mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🎨 Add the custom-dailynote-yyyyMMdd attribute when creating a dailynote doc https://github.com/siyuan-note/siyuan/issues/9807
This commit is contained in:
parent
5c5f7da1e6
commit
773a6f5ec2
1 changed files with 15 additions and 2 deletions
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue