diff --git a/components/account_page/AccountFunding.tsx b/components/account_page/AccountFunding.tsx index 3d9145f0..ea88cd6d 100644 --- a/components/account_page/AccountFunding.tsx +++ b/components/account_page/AccountFunding.tsx @@ -44,9 +44,9 @@ const AccountFunding = () => { dataToExport = [ ...dataToExport, ...hourlyFunding[asset].map((funding) => { - console.log(funding) + const timestamp = new Date(funding.time) return { - timestamp: funding.time, + timestamp: `${timestamp.toLocaleDateString()} ${timestamp.toLocaleTimeString()}`, asset: asset, amount: funding.total_funding, } @@ -54,7 +54,9 @@ const AccountFunding = () => { ] } - const title = 'Mango Markets - Funding History - ' + new Date().toString() + const title = `${ + mangoAccount.name || mangoAccount.publicKey + }-Funding-${new Date().toLocaleDateString()}` const columns = ['Timestamp', 'Asset', 'Amount'] exportDataToCSV(dataToExport, title, columns, t) diff --git a/components/account_page/AccountHistory.tsx b/components/account_page/AccountHistory.tsx index 94d4402f..43b6a45e 100644 --- a/components/account_page/AccountHistory.tsx +++ b/components/account_page/AccountHistory.tsx @@ -57,7 +57,7 @@ export default function AccountHistory() { if (view == 'Trades') { dataToExport = tradeHistory.map((trade) => { - console.log(trade) + const timestamp = new Date(trade.loadTimestamp) return { asset: trade.marketName, orderType: trade.side.toUpperCase(), @@ -66,7 +66,7 @@ export default function AccountHistory() { value: trade.value, liquidity: trade.liquidity, fee: trade.feeCost, - date: trade.loadTimestamp, + date: `${timestamp.toLocaleDateString()} ${timestamp.toLocaleTimeString()}`, } }) headers = [ @@ -84,9 +84,10 @@ export default function AccountHistory() { .filter((val) => val.activity_type == view) .map((row) => { row = row.activity_details + const timestamp = new Date(row.block_datetime) return { - date: row.block_datetime, + date: `${timestamp.toLocaleDateString()} ${timestamp.toLocaleTimeString()}`, asset: row.symbol, quantity: row.quantity, value: row.usd_equivalent, @@ -105,7 +106,9 @@ export default function AccountHistory() { } const tab = historyViews.filter((v) => v.key == view)[0].label - const title = `Mango Markets - ${tab} - ' + ${new Date().toString()}` + const title = `${ + mangoAccount.name || mangoAccount.publicKey + }-${tab}-${new Date().toLocaleDateString()}` exportDataToCSV(dataToExport, title, headers, t) } diff --git a/components/account_page/AccountInterest.tsx b/components/account_page/AccountInterest.tsx index 84cfbcb8..fb65d3a2 100644 --- a/components/account_page/AccountInterest.tsx +++ b/components/account_page/AccountInterest.tsx @@ -62,8 +62,9 @@ const AccountInterest = () => { dataToExport = [ ...dataToExport, ...hourlyInterestStats[asset].map((interest) => { + const timestamp = new Date(interest.time) return { - timestamp: interest.time, + timestamp: `${timestamp.toLocaleDateString()} ${timestamp.toLocaleTimeString()}`, asset: asset, deposit_interest: interest.deposit_interest, borrow_interest: interest.borrow_interest, @@ -72,7 +73,9 @@ const AccountInterest = () => { ] } - const title = 'Mango Markets - Interest History - ' + new Date().toString() + const title = `${ + mangoAccount.name || mangoAccount.publicKey + }-Interest-${new Date().toLocaleDateString()}` const headers = [ 'Timestamp', 'Asset',