From 59144e727d0a88901c33858a8c2985b4cfdd8571 Mon Sep 17 00:00:00 2001 From: tjs Date: Tue, 1 Mar 2022 17:24:31 -0500 Subject: [PATCH] show timestamps for pnl and account value on account page --- components/account_page/AccountOverview.tsx | 11 ++++++++++- components/account_page/PerformanceChart.tsx | 8 +++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/components/account_page/AccountOverview.tsx b/components/account_page/AccountOverview.tsx index f1edf8dd..9bb6eedf 100644 --- a/components/account_page/AccountOverview.tsx +++ b/components/account_page/AccountOverview.tsx @@ -112,7 +112,16 @@ export default function AccountOverview() {
- {t('pnl')} ({t('all-time')}) + {t('pnl')}{' '} + {hourlyPerformanceStats?.length ? ( + + ( + {dayjs(hourlyPerformanceStats[0]['time']).format( + 'MMM D YYYY, h:mma' + )} + ) + + ) : null}
{formatUsdValue(pnl)} diff --git a/components/account_page/PerformanceChart.tsx b/components/account_page/PerformanceChart.tsx index c653b88b..0392940b 100644 --- a/components/account_page/PerformanceChart.tsx +++ b/components/account_page/PerformanceChart.tsx @@ -231,9 +231,11 @@ const PerformanceChart = ({ : formatUsdValue(accountValue)}
- {dayjs(chartData[chartData.length - 1]['time']).format( - 'ddd MMM D YYYY, h:mma' - )} + {chartToShow === 'PnL' + ? dayjs(chartData[chartData.length - 1]['time']).format( + 'ddd MMM D YYYY, h:mma' + ) + : dayjs().format('ddd MMM D YYYY, h:mma')}
) : (