Skip to content

Commit c6102b9

Browse files
lint fix
1 parent d8664db commit c6102b9

File tree

1 file changed

+14
-23
lines changed

1 file changed

+14
-23
lines changed

datahub-web-react/src/app/analyticsDashboard/components/TimeSeriesChart.tsx

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -88,26 +88,20 @@ const formatAxisDate = (value: number, chartData: TimeSeriesChartType) => {
8888
const date = new Date(value);
8989

9090
// force UTC
91-
const utcDate = new Date(
92-
Date.UTC(
93-
date.getUTCFullYear(),
94-
date.getUTCMonth(),
95-
date.getUTCDate()
96-
)
97-
);
98-
91+
const utcDate = new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()));
92+
9993
return chartData.interval === 'MONTH'
100-
? utcDate.toLocaleDateString('en-US', {
101-
month: 'short',
102-
year: 'numeric',
103-
timeZone: 'UTC'
104-
})
105-
: utcDate.toLocaleDateString('en-US', {
106-
year: 'numeric',
107-
month: 'short',
108-
day: 'numeric',
109-
timeZone: 'UTC'
110-
});
94+
? utcDate.toLocaleDateString('en-US', {
95+
month: 'short',
96+
year: 'numeric',
97+
timeZone: 'UTC',
98+
})
99+
: utcDate.toLocaleDateString('en-US', {
100+
year: 'numeric',
101+
month: 'short',
102+
day: 'numeric',
103+
timeZone: 'UTC',
104+
});
111105
};
112106

113107
export const TimeSeriesChart = ({
@@ -178,10 +172,7 @@ export const TimeSeriesChart = ({
178172
tooltipData?.nearestDatum && (
179173
<div>
180174
<div>
181-
{formatAxisDate(
182-
accessors.xAccessor(tooltipData.nearestDatum.datum),
183-
chartData
184-
)}
175+
{formatAxisDate(accessors.xAccessor(tooltipData.nearestDatum.datum), chartData)}
185176
</div>
186177
<div>{accessors.yAccessor(tooltipData.nearestDatum.datum)}</div>
187178
</div>

0 commit comments

Comments
 (0)