Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Daniel5c8fb01dc2fa
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 3d92c68c75..884d01a4f7 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -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)