|
|
@ -137,13 +137,6 @@ export const shortenProxyAddress = (address: string) => { |
|
|
|
|
|
|
|
|
|
|
|
export const shortenDate = (dateString: string) => { |
|
|
|
export const shortenDate = (dateString: string) => { |
|
|
|
const date = new Date(dateString) |
|
|
|
const date = new Date(dateString) |
|
|
|
const now = new Date() |
|
|
|
|
|
|
|
const diff = now.getTime() - date.getTime() |
|
|
|
|
|
|
|
const oneDay = 24 * 60 * 60 * 1000 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (diff < oneDay) { |
|
|
|
|
|
|
|
return date.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' }) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return date.toLocaleDateString(undefined, { month: "short", day: "numeric" }) + ', ' + date.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' }) |
|
|
|
return date.toLocaleDateString(undefined, { month: "short", day: "numeric" }) + ', ' + date.toLocaleTimeString(undefined, { hour: '2-digit', minute: '2-digit' }) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|