diff --git a/src/pages/TopStatsPage/Transaction.tsx b/src/pages/TopStatsPage/Transaction.tsx index 9f6c83c..8c94275 100644 --- a/src/pages/TopStatsPage/Transaction.tsx +++ b/src/pages/TopStatsPage/Transaction.tsx @@ -1,5 +1,5 @@ import React, {useEffect, useState} from 'react' -import {Box, Spinner, Tip, Text} from "grommet"; +import {Box, Spinner, Text, Tip} from "grommet"; import {TopTable} from "./CommonTopTable"; import {getTopMetricsByType} from "../../api/client"; import {MetricsTopItem, MetricsTopPeriod, MetricsTopType} from "../../types"; @@ -73,7 +73,7 @@ export const TransactionTopStats = () => { }, [period]) const dateFrom = oneSenders.length > 0 ? dayjs(oneSenders[0].updatedAt).subtract(period, 'day') : '' - const dateTo = oneSenders.length > 0 ? dayjs(oneSenders[0].updatedAt): '' + const dateTo = oneSenders.length > 0 ? dayjs(oneSenders[0].updatedAt).subtract(1, 'day'): '' return @@ -93,7 +93,14 @@ export const TransactionTopStats = () => { dropProps={{ align: { bottom: "top" }}} content={} > - {dateFrom.format('DD MMM')} - {dateTo.format('DD MMM')} + + {period === MetricsTopPeriod.d1 && + {dateTo.format('DD MMM')} + } + {period !== MetricsTopPeriod.d1 && + {dateFrom.format('DD MMM')} - {dateTo.format('DD MMM')} + } + }