Browse Source

Merge pull request #926 from meriadec/chart-tooltip-date-format

Correct date format for chart Tooltip
master
Gaëtan Renaudeau 7 years ago
committed by GitHub
parent
commit
440a783379
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/components/BalanceSummary/index.js
  2. 3
      src/components/base/Chart/Tooltip.js

3
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}
/>
<Box ff="Open Sans|Regular" color="grey" fontSize={3} mt={2}>
{d.date.toISOString().substr(0, 10)}
{moment(d.date).format('L')}
</Box>
</Fragment>
)

3
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 = ({
/>
)}
<Box ff="Open Sans|Regular" color="grey" fontSize={3} mt={2}>
{item.date.toISOString().substr(0, 10)}
{moment(item.date).format('L')}
</Box>
</Fragment>
)}

Loading…
Cancel
Save