Skip to content

Commit

Permalink
[front]fix type(#7921)
Browse files Browse the repository at this point in the history
  • Loading branch information
CelineSebe committed Sep 19, 2024
1 parent c772890 commit a29a0f0
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ const WidgetHorizontalBars = ({
const theme = useTheme<Theme>();
const navigate = useNavigate();

const getFormattedValue = (value: any) => {
const getFormattedValue = (value: string | number) => {
if (typeof value === 'number') {
simpleNumberFormat(value);
}
const timestampInMs = parseInt(value, 10);

if (!Number.isNaN(timestampInMs)) {
const convertedDate = timestamp(timestampInMs);
const date = dateFormat(convertedDate, 'YYYY-MM-DD');
if (date) return date;
} else {
const newTimestamp = parseInt(value, 10);
if (!Number.isNaN(timestamp)) {
const convertedDate = timestamp(newTimestamp);
const date = dateFormat(convertedDate, 'YYYY-MM-DD');
if (date) return date;
}
}
return value;
};
Expand Down

0 comments on commit a29a0f0

Please sign in to comment.