From dbdec1869f76d7e2fd0c9647cdb583e5271dbcd5 Mon Sep 17 00:00:00 2001 From: meriadec Date: Sun, 8 Jul 2018 22:37:58 +0200 Subject: [PATCH] Correct date format for chart Tooltip --- src/components/BalanceSummary/index.js | 3 ++- src/components/base/Chart/Tooltip.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/BalanceSummary/index.js b/src/components/BalanceSummary/index.js index e0b9c02e..0d012302 100644 --- a/src/components/BalanceSummary/index.js +++ b/src/components/BalanceSummary/index.js @@ -1,6 +1,7 @@ // @flow import React, { Fragment } from 'react' +import moment from 'moment' import { formatShort } from '@ledgerhq/live-common/lib/helpers/currencies' import type { Currency, Account } from '@ledgerhq/live-common/lib/types' @@ -90,7 +91,7 @@ const BalanceSummary = ({ val={d.value} /> - {d.date.toISOString().substr(0, 10)} + {moment(d.date).format('L')} ) diff --git a/src/components/base/Chart/Tooltip.js b/src/components/base/Chart/Tooltip.js index 900afa8e..315e85be 100644 --- a/src/components/base/Chart/Tooltip.js +++ b/src/components/base/Chart/Tooltip.js @@ -1,6 +1,7 @@ // @flow import React, { Fragment } from 'react' +import moment from 'moment' import styled from 'styled-components' import type { Unit, Currency } from '@ledgerhq/live-common/lib/types' @@ -68,7 +69,7 @@ const Tooltip = ({ /> )} - {item.date.toISOString().substr(0, 10)} + {moment(item.date).format('L')} )}