Skip to content

Commit 9c3e24b

Browse files
committed
fix: incorrect date display
issue: #117
1 parent ec82570 commit 9c3e24b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ui/src/lib/api.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,11 @@ export async function* transformAsyncIterable<T, U>(
156156

157157

158158
export function formatDate(timestamp: bigint | number | string) {
159-
const bigIntTimestamp = typeof timestamp === 'bigint' ? Number(timestamp) : timestamp;
160-
return new Date(bigIntTimestamp).toLocaleDateString('en-US', {
159+
const numericTimestamp = typeof timestamp === 'bigint' ?
160+
// convert to ms from seconds
161+
Number(timestamp) * 1000 :
162+
timestamp;
163+
return new Date(numericTimestamp).toLocaleDateString('en-US', {
161164
year: 'numeric',
162165
month: 'short',
163166
day: 'numeric',

0 commit comments

Comments
 (0)