Changing time table viz to pass formatTime a date (#7020)

This commit is contained in:
michellethomas
2019-03-13 09:34:51 -07:00
committed by GitHub
parent d308c842f9
commit 7f3c145b1f

View File

@@ -23,6 +23,7 @@ import { scaleLinear } from 'd3-scale';
import { Table, Thead, Th, Tr, Td } from 'reactable-arc';
import { formatNumber } from '@superset-ui/number-format';
import { formatTime } from '@superset-ui/time-format';
import moment from 'moment';
import MetricOption from '../../components/MetricOption';
import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
@@ -148,7 +149,7 @@ class TimeTable extends React.PureComponent {
renderTooltip={({ index }) => (
<div>
<strong>{formatNumber(column.d3format, sparkData[index])}</strong>
<div>{formatTime(column.dateFormat, entries[index].time)}</div>
<div>{formatTime(column.dateFormat, moment.utc(entries[index].time).toDate())}</div>
</div>
)}
/>