diff options
| author | adamdottv <[email protected]> | 2025-05-13 11:34:48 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-13 11:34:48 -0500 |
| commit | d8f3b606258a5655d73acc94d6cb37b421350817 (patch) | |
| tree | 8979ade053f753662939271ead5659c64292261f | |
| parent | cf8e16018dceffa6a7c32022b8f81039f784142d (diff) | |
| download | opencode-d8f3b606258a5655d73acc94d6cb37b421350817.tar.gz opencode-d8f3b606258a5655d73acc94d6cb37b421350817.zip | |
chore: refactoring
| -rw-r--r-- | internal/history/history.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/history/history.go b/internal/history/history.go index 137fa429c..80fa09d9d 100644 --- a/internal/history/history.go +++ b/internal/history/history.go @@ -9,6 +9,7 @@ import ( "strconv" "strings" "sync" + "time" "github.com/google/uuid" "github.com/sst/opencode/internal/db" @@ -25,8 +26,8 @@ type File struct { Path string Content string Version string - CreatedAt int64 - UpdatedAt int64 + CreatedAt time.Time + UpdatedAt time.Time } const ( @@ -367,8 +368,8 @@ func (s *service) fromDBItem(item db.File) File { Path: item.Path, Content: item.Content, Version: item.Version, - CreatedAt: item.CreatedAt * 1000, - UpdatedAt: item.UpdatedAt * 1000, + CreatedAt: time.UnixMilli(item.CreatedAt * 1000), + UpdatedAt: time.UnixMilli(item.UpdatedAt * 1000), } } |
