diff --git a/src/components/accounts/TransactionDataTable.tsx b/src/components/accounts/TransactionDataTable.tsx index d3952de..58dc793 100644 --- a/src/components/accounts/TransactionDataTable.tsx +++ b/src/components/accounts/TransactionDataTable.tsx @@ -48,7 +48,23 @@ const TransactionDataTable = () => { }, []); - + function formatTimestamp(isoString, options = { timeZone: 'local' }) { + // Parse the ISO string to a Date object + const date = new Date(isoString); + + if (isNaN(date)) { + return 'Invalid date'; + } + + // Return formatted date string + if (options.timeZone === 'UTC') { + return date.toUTCString(); // e.g. "Mon, 04 Aug 2025 13:46:46 GMT" + } else { + return date.toLocaleString(); // e.g. "8/4/2025, 9:46:46 AM" (based on local time zone) + } + } + + return ( <> @@ -96,7 +112,7 @@ const TransactionDataTable = () => {