From c878452da4b967069b0edd10fe54675f09cb7646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3za=20Nagy?= Date: Tue, 22 Oct 2024 14:28:51 +0200 Subject: [PATCH 1/2] feat: update date formatting to not show the day of week --- src/shared/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/utils.ts b/src/shared/utils.ts index be70a651..0b882a66 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -37,11 +37,12 @@ export function findEthereumNetworkByName(ethereumNetworkName: string): Chain { export function formatEvent(event: DetailedEvent): FormattedEvent { const isMint = event.eventType === 'mint'; + const date = new Date(event.timestamp * 1000); return { dlcBTCAmount: isMint ? event.value : -event.value, merchant: isMint ? event.to : event.from, txHash: event.txHash, - date: new Date(event.timestamp * 1000).toDateString(), + date: date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }).replace(',', ''), isMint, chain: event.chain, isCCIP: event.isCCIP, From d86c17efda959f7946e4553b05b4bf54a541626f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3za=20Nagy?= Date: Tue, 22 Oct 2024 14:33:38 +0200 Subject: [PATCH 2/2] fix: correct prettify finds --- src/shared/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 0b882a66..bdf6bdc2 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -42,7 +42,9 @@ export function formatEvent(event: DetailedEvent): FormattedEvent { dlcBTCAmount: isMint ? event.value : -event.value, merchant: isMint ? event.to : event.from, txHash: event.txHash, - date: date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }).replace(',', ''), + date: date + .toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) + .replace(',', ''), isMint, chain: event.chain, isCCIP: event.isCCIP,