mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
parent
0296717b02
commit
d3b68fe56d
1 changed files with 14 additions and 4 deletions
|
|
@ -70,13 +70,23 @@ func statAsset(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
updated := t.ModTime().UnixMilli()
|
||||
hUpdated := t.ModTime().Format("2006-01-02 15:04:05")
|
||||
created := updated
|
||||
hCreated := hUpdated
|
||||
// Check birthtime before use
|
||||
if t.HasBirthTime() {
|
||||
created = t.BirthTime().UnixMilli()
|
||||
hCreated = t.BirthTime().Format("2006-01-02 15:04:05")
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"size": info.Size(),
|
||||
"hSize": humanize.Bytes(uint64(info.Size())),
|
||||
"created": t.BirthTime().UnixMilli(),
|
||||
"hCreated": t.BirthTime().Format("2006-01-02 15:04:05"),
|
||||
"updated": t.ModTime().UnixMilli(),
|
||||
"hUpdated": t.ModTime().Format("2006-01-02 15:04:05"),
|
||||
"created": created,
|
||||
"hCreated": hCreated,
|
||||
"updated": updated,
|
||||
"hUpdated": hUpdated,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue