diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js index ef72a1d213b..e8b41e80e36 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.js @@ -20,7 +20,8 @@ // @flow import React from 'react'; import classNames from 'classnames'; -import moment from 'moment'; +import { FormattedRelative } from 'react-intl'; +import DateFormatter from '../../../components/intl/DateFormatter'; import Tooltip from '../../../components/controls/Tooltip'; import { getPeriodLabel, getPeriodDate } from '../../../helpers/periods'; import { translate, translateWithParameters } from '../../../helpers/l10n'; @@ -53,8 +54,13 @@ export default function LeakPeriodLegend({ className, component, period } /*: Pr } const date = getPeriodDate(period); - const fromNow = moment(date).fromNow(); - const tooltip = fromNow + ', ' + moment(date).format('LL'); + const tooltip = ( + <div> + <FormattedRelative value={date} /> + {', '} + <DateFormatter date={date} long={true} /> + </div> + ); return ( <Tooltip placement="left" overlay={tooltip}> {label} |