summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-05-13 11:34:48 -0500
committeradamdottv <[email protected]>2025-05-13 11:34:48 -0500
commitd8f3b606258a5655d73acc94d6cb37b421350817 (patch)
tree8979ade053f753662939271ead5659c64292261f
parentcf8e16018dceffa6a7c32022b8f81039f784142d (diff)
downloadopencode-d8f3b606258a5655d73acc94d6cb37b421350817.tar.gz
opencode-d8f3b606258a5655d73acc94d6cb37b421350817.zip
chore: refactoring
-rw-r--r--internal/history/history.go9
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),
}
}