Skip to content

Commit 0364dae

Browse files
committed
fix(revert): times.ts and RelativeTime
1 parent e31d0aa commit 0364dae

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

src/components/RelativeTime.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Tooltip2, Tooltip2Props } from '@blueprintjs/popover2'
22

33
import { FC, useEffect, useState } from 'react'
44

5-
import { formatDate, formatRelativeTime } from '../utils/times'
5+
import { formatDateTime, formatRelativeTime } from '../utils/times'
66

77
interface RelativeTimeProps {
88
moment: string | number | Date
@@ -21,7 +21,7 @@ export const RelativeTime: FC<RelativeTimeProps> = ({
2121
? new Date(moment).getTime()
2222
: moment
2323

24-
const formattedDate = formatDate(timestamp)
24+
const formattedDate = formatDateTime(timestamp)
2525
const [relativeTime, setRelativeTime] = useState(
2626
formatRelativeTime(timestamp),
2727
)

src/utils/times.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,3 @@ export function formatDuration(milliseconds: number) {
4848
return `${milliseconds}ms`
4949
}
5050
}
51-
52-
export function formatDate(timestamp: number): string {
53-
const date = new Date(timestamp)
54-
55-
// Get components
56-
const year = date.getFullYear()
57-
const month = String(date.getMonth() + 1).padStart(2, '0')
58-
const day = String(date.getDate()).padStart(2, '0')
59-
const hours = String(date.getHours()).padStart(2, '0')
60-
const minutes = String(date.getMinutes()).padStart(2, '0')
61-
const seconds = String(date.getSeconds()).padStart(2, '0')
62-
63-
// Format as YYYY-MM-DD HH:MM:SS for both languages
64-
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
65-
}

0 commit comments

Comments
 (0)