Skip to content

Commit

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

const getFormattedValue = (value: string | number) => {
const getFormattedValue = (value: string | number | null) => {
if (typeof value === 'number') {
simpleNumberFormat(value);
} else {
return simpleNumberFormat(value);
}
if (typeof value === 'string') {
const newTimestamp = parseInt(value, 10);
if (!Number.isNaN(timestamp)) {
const convertedDate = timestamp(newTimestamp);
Expand Down
2 changes: 1 addition & 1 deletion opencti-platform/opencti-front/src/utils/Time.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const yearsAgo = (number) => moment(dayStartDate()).subtract(number, 'yea

export const yearFormat = (data) => (data && data !== '-' ? parse(data).format(yearDateFormat) : '');

export const dateFormat = (data, specificFormat = '') => {
export const dateFormat = (data, specificFormat = null) => {
if (isNone(data)) {
return null;
}
Expand Down

0 comments on commit 4be8415

Please sign in to comment.