From 4b208e90bf28189dcb80eafe22c27492f2717dc4 Mon Sep 17 00:00:00 2001 From: "m.ray" <16125548+MadalinaRaicu@users.noreply.github.com> Date: Thu, 14 Dec 2023 17:10:17 +0200 Subject: [PATCH] fix(trading): internal timestamp date unix formatting (#5505) --- .../lib/components/market-info/market-info-panels.spec.tsx | 2 +- .../src/lib/components/market-info/market-info-panels.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/markets/src/lib/components/market-info/market-info-panels.spec.tsx b/libs/markets/src/lib/components/market-info/market-info-panels.spec.tsx index 12db84607..b7095e335 100644 --- a/libs/markets/src/lib/components/market-info/market-info-panels.spec.tsx +++ b/libs/markets/src/lib/components/market-info/market-info-panels.spec.tsx @@ -135,7 +135,7 @@ describe('MarketInfoPanels', () => { render(); expect(screen.getByText('Internal conditions')).toBeInTheDocument(); const dateFromUnixTimestamp = condition.value - ? getDateTimeFormat().format(new Date(parseInt(condition.value))) + ? getDateTimeFormat().format(new Date(parseInt(condition.value) * 1000)) : '-'; expect( screen.getByText( diff --git a/libs/markets/src/lib/components/market-info/market-info-panels.tsx b/libs/markets/src/lib/components/market-info/market-info-panels.tsx index bdef4ee96..66c35a21c 100644 --- a/libs/markets/src/lib/components/market-info/market-info-panels.tsx +++ b/libs/markets/src/lib/components/market-info/market-info-panels.tsx @@ -1263,7 +1263,9 @@ export const DataSourceProof = ({ {data.sourceType.sourceType?.conditions?.map((condition, i) => { if (!condition) return null; const dateFromUnixTimestamp = condition.value - ? getDateTimeFormat().format(new Date(parseInt(condition.value))) + ? getDateTimeFormat().format( + new Date(parseInt(condition.value) * 1000) + ) : '-'; return (