Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkarchacryl committed Jan 17, 2025
1 parent d8664db commit c6102b9
Showing 1 changed file with 14 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
};

Check warning on line 105 in datahub-web-react/src/app/analyticsDashboard/components/TimeSeriesChart.tsx

View check run for this annotation

Codecov / codecov/patch

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

Added lines #L88 - L105 were not covered by tests

export const TimeSeriesChart = ({
Expand Down Expand Up @@ -178,10 +172,7 @@ export const TimeSeriesChart = ({
tooltipData?.nearestDatum && (
<div>
<div>
{formatAxisDate(
accessors.xAccessor(tooltipData.nearestDatum.datum),
chartData
)}
{formatAxisDate(accessors.xAccessor(tooltipData.nearestDatum.datum), chartData)}

Check warning on line 175 in datahub-web-react/src/app/analyticsDashboard/components/TimeSeriesChart.tsx

View check run for this annotation

Codecov / codecov/patch

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

Added line #L175 was not covered by tests
</div>
<div>{accessors.yAccessor(tooltipData.nearestDatum.datum)}</div>
</div>
Expand Down

0 comments on commit c6102b9

Please sign in to comment.