diff --git a/datahub-web-react/src/app/analyticsDashboard/components/TimeSeriesChart.tsx b/datahub-web-react/src/app/analyticsDashboard/components/TimeSeriesChart.tsx index 3248223eedd1b7..6243f611888d50 100644 --- a/datahub-web-react/src/app/analyticsDashboard/components/TimeSeriesChart.tsx +++ b/datahub-web-react/src/app/analyticsDashboard/components/TimeSeriesChart.tsx @@ -88,26 +88,20 @@ const formatAxisDate = (value: number, chartData: TimeSeriesChartType) => { const date = new Date(value); // force UTC - const utcDate = new Date( - Date.UTC( - date.getUTCFullYear(), - date.getUTCMonth(), - date.getUTCDate() - ) - ); - + const utcDate = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate())); + return chartData.interval === 'MONTH' - ? utcDate.toLocaleDateString('en-US', { - month: 'short', - year: 'numeric', - timeZone: 'UTC' - }) - : utcDate.toLocaleDateString('en-US', { - year: 'numeric', - month: 'short', - day: 'numeric', - timeZone: 'UTC' - }); + ? utcDate.toLocaleDateString('en-US', { + month: 'short', + year: 'numeric', + timeZone: 'UTC', + }) + : utcDate.toLocaleDateString('en-US', { + year: 'numeric', + month: 'short', + day: 'numeric', + timeZone: 'UTC', + }); }; export const TimeSeriesChart = ({ @@ -178,10 +172,7 @@ export const TimeSeriesChart = ({ tooltipData?.nearestDatum && (