show timestamps for pnl and account value on account page

This commit is contained in:
tjs 2022-03-01 17:24:31 -05:00
parent c41af04f8e
commit 59144e727d
2 changed files with 15 additions and 4 deletions

View File

@ -112,7 +112,16 @@ export default function AccountOverview() {
</div>
<div className="border-b border-th-bkg-4 p-3 sm:p-4">
<div className="pb-0.5 text-th-fgd-3 text-xs sm:text-sm">
{t('pnl')} ({t('all-time')})
{t('pnl')}{' '}
{hourlyPerformanceStats?.length ? (
<span className="text-th-fgd-4 text-xxs">
(
{dayjs(hourlyPerformanceStats[0]['time']).format(
'MMM D YYYY, h:mma'
)}
)
</span>
) : null}
</div>
<div className="font-bold text-th-fgd-3 text-xl sm:text-2xl">
{formatUsdValue(pnl)}

View File

@ -231,9 +231,11 @@ const PerformanceChart = ({
: formatUsdValue(accountValue)}
</div>
<div className="text-xs font-normal text-th-fgd-4">
{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')}
</div>
</>
) : (