Skip to content

Commit 094371c

Browse files
committed
fix date format
1 parent 8bf1d2d commit 094371c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/lib/torch/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,16 @@ export const formatAddress = (address: Address) => {
193193
}
194194

195195
export const formatDate = (timestamp: number) => {
196-
return new Date(timestamp * 1000).toLocaleDateString("en-US", {
197-
year: "numeric",
198-
month: "short",
199-
day: "numeric",
200-
hour: "2-digit",
196+
const date = new Date(timestamp * 1000)
197+
const month = date.toLocaleDateString("en-US", { month: "long" })
198+
const day = date.getDate().toString().padStart(2, "0")
199+
const time = date.toLocaleTimeString("en-US", {
200+
hour: "numeric",
201201
minute: "2-digit",
202+
hour12: true,
202203
})
204+
205+
return `${month} ${day}, ${time}`
203206
}
204207

205208
export const getEtherscanUrl = (txHash: string) => {

0 commit comments

Comments
 (0)