🎨 Database template column supports created and updated built-in variables https://github.com/siyuan-note/siyuan/issues/9364

This commit is contained in:
Daniel 2023-10-08 10:54:29 +08:00
parent 549a8eeea4
commit 5c8fb01dc2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -61,7 +61,7 @@ func renderTemplateCol(blockID, tplContent string, rowValues []*av.KeyValues) st
createdStr = createdStr[:len("20060102150405")]
}
created, parseErr := time.Parse("20060102150405", createdStr)
if nil != parseErr {
if nil == parseErr {
dataModel["created"] = created
} else {
logging.LogWarnf("parse created [%s] failed: %s", createdStr, parseErr)
@ -69,7 +69,7 @@ func renderTemplateCol(blockID, tplContent string, rowValues []*av.KeyValues) st
}
updatedStr := ial["updated"]
updated, parseErr := time.Parse("20060102150405", updatedStr)
if nil != parseErr {
if nil == parseErr {
dataModel["updated"] = updated
} else {
logging.LogWarnf("parse updated [%s] failed: %s", updatedStr, parseErr)