🎨 Database table view template columns support reference date columns https://github.com/siyuan-note/siyuan/issues/9887

This commit is contained in:
Daniel 2023-12-15 09:53:34 +08:00
parent 0e58605f2c
commit 5bf45bfde2
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 4 additions and 0 deletions

View file

@ -450,6 +450,8 @@ func renderTemplateCol(ial map[string]string, tplContent string, rowValues []*av
v := rowValue.Values[0]
if av.KeyTypeNumber == v.Type {
dataModel[rowValue.Key.Name] = v.Number.Content
} else if av.KeyTypeDate == v.Type {
dataModel[rowValue.Key.Name] = time.UnixMilli(v.Date.Content)
} else {
dataModel[rowValue.Key.Name] = v.String()
}

View file

@ -863,6 +863,8 @@ func renderTemplateCol(ial map[string]string, tplContent string, rowValues []*av
v := rowValue.Values[0]
if av.KeyTypeNumber == v.Type {
dataModel[rowValue.Key.Name] = v.Number.Content
} else if av.KeyTypeDate == v.Type {
dataModel[rowValue.Key.Name] = time.UnixMilli(v.Date.Content)
} else {
dataModel[rowValue.Key.Name] = v.String()
}