mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 00:20:12 +01:00
🎨 Add created and updated type column to database https://github.com/siyuan-note/siyuan/issues/9371
This commit is contained in:
parent
c1e0b4ff60
commit
917e21f25e
4 changed files with 302 additions and 4 deletions
|
|
@ -924,7 +924,7 @@ func addAttributeViewColumn(operation *Operation) (err error) {
|
|||
|
||||
keyType := av.KeyType(operation.Typ)
|
||||
switch keyType {
|
||||
case av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset, av.KeyTypeTemplate:
|
||||
case av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset, av.KeyTypeTemplate, av.KeyTypeCreated, av.KeyTypeUpdated:
|
||||
var icon string
|
||||
if nil != operation.Data {
|
||||
icon = operation.Data.(string)
|
||||
|
|
@ -1016,7 +1016,7 @@ func updateAttributeViewColumn(operation *Operation) (err error) {
|
|||
|
||||
colType := av.KeyType(operation.Typ)
|
||||
switch colType {
|
||||
case av.KeyTypeBlock, av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset, av.KeyTypeTemplate:
|
||||
case av.KeyTypeBlock, av.KeyTypeText, av.KeyTypeNumber, av.KeyTypeDate, av.KeyTypeSelect, av.KeyTypeMSelect, av.KeyTypeURL, av.KeyTypeEmail, av.KeyTypePhone, av.KeyTypeMAsset, av.KeyTypeTemplate, av.KeyTypeCreated, av.KeyTypeUpdated:
|
||||
for _, keyValues := range attrView.KeyValues {
|
||||
if keyValues.Key.ID == operation.ID {
|
||||
keyValues.Key.Name = operation.Name
|
||||
|
|
|
|||
|
|
@ -1909,8 +1909,18 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
|
|||
mdTableRow.AppendChild(mdTableCell)
|
||||
var val string
|
||||
if nil != cell.Value {
|
||||
if av.KeyTypeDate == cell.Value.Type && nil != cell.Value.Date {
|
||||
cell.Value.Date = av.NewFormattedValueDate(cell.Value.Date.Content, cell.Value.Date.Content2, av.DateFormatNone)
|
||||
if av.KeyTypeDate == cell.Value.Type {
|
||||
if nil != cell.Value.Date {
|
||||
cell.Value.Date = av.NewFormattedValueDate(cell.Value.Date.Content, cell.Value.Date.Content2, av.DateFormatNone)
|
||||
}
|
||||
} else if av.KeyTypeCreated == cell.Value.Type {
|
||||
if nil != cell.Value.Created {
|
||||
cell.Value.Created = av.NewFormattedValueCreated(cell.Value.Date.Content, av.CreatedFormatNone)
|
||||
}
|
||||
} else if av.KeyTypeUpdated == cell.Value.Type {
|
||||
if nil != cell.Value.Updated {
|
||||
cell.Value.Updated = av.NewFormattedValueUpdated(cell.Value.Date.Content, av.UpdatedFormatNone)
|
||||
}
|
||||
}
|
||||
|
||||
val = cell.Value.String()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue