Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Oct 13, 2023
2 parents 73edee5 + 00ed190 commit 1815ec1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/av/av.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,10 @@ func SaveAttributeView(av *AttributeView) (err error) {
// 补全 block 的创建时间和更新时间
for _, v := range kv.Values {
if 0 == v.Block.Created {
if "" == v.Block.ID {
v.Block.ID = ast.NewNodeID()
}

createdStr := v.Block.ID[:len("20060102150405")]
created, parseErr := time.ParseInLocation("20060102150405", createdStr, time.Local)
if nil == parseErr {
Expand Down
4 changes: 4 additions & 0 deletions kernel/model/attribute_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ func RenderAttributeView(avID string) (viewable av.Viewable, attrView *av.Attrib
case av.KeyTypeBlock: // 补全 block 的创建时间和更新时间
for _, v := range kv.Values {
if 0 == v.Block.Created {
if "" == v.Block.ID {
v.Block.ID = ast.NewNodeID()
}

createdStr := v.Block.ID[:len("20060102150405")]
created, parseErr := time.ParseInLocation("20060102150405", createdStr, time.Local)
if nil == parseErr {
Expand Down

0 comments on commit 1815ec1

Please sign in to comment.