diff --git a/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx b/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx index 44ba1d3104805..1769119593c0e 100644 --- a/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/time_comparison/index.tsx @@ -84,13 +84,13 @@ function getSelectOptions({ }), }; - const dateDiff = Math.round( + const dateDiff = Number( getDateDifference({ start: momentStart, end: momentEnd, unitOfTime: 'days', precise: true, - }) + }).toFixed(2) ); const isRangeToNow = rangeTo === 'now'; diff --git a/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts b/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts index 4f18681da5bcd..2ee4a717106eb 100644 --- a/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts +++ b/x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts @@ -30,17 +30,12 @@ export function getLatencyChartSelector({ latencyChart?: LatencyChartsResponse; theme: EuiTheme; latencyAggregationType?: string; -}): LatencyChartData { +}): Partial { if ( !latencyChart?.currentPeriod.latencyTimeseries || !latencyAggregationType ) { - return { - currentPeriod: undefined, - previousPeriod: undefined, - mlJobId: undefined, - anomalyTimeseries: undefined, - }; + return {}; } return { currentPeriod: getLatencyTimeseries({ @@ -73,9 +68,7 @@ function getPreviousPeriodTimeseries({ color: theme.eui.euiColorLightestShade, title: i18n.translate( 'xpack.apm.serviceOverview.latencyChartTitle.previousPeriodLabel', - { - defaultMessage: 'Previous period', - } + { defaultMessage: 'Previous period' } ), }; }