Skip to content

Commit

Permalink
Hotfix economy/overview rates displaying as dates (OpenBB-finance#5269
Browse files Browse the repository at this point in the history
)

* fix: `economy/overview` rates displaying as dates

* Fix Test

---------

Co-authored-by: James Maslek <[email protected]>
  • Loading branch information
tehcoderer and jmaslek authored Aug 1, 2023
1 parent 3b5fc53 commit ae91a3f
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 49 deletions.
4 changes: 2 additions & 2 deletions frontend-components/tables/src/components/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export default function Table({
: columns[0];
const indexValue = indexLabel ? row[indexLabel] : null;
const value = row[column];
const only_numbers = value?.toString().replace(/[^0-9]/g, "") ?? "";
const only_numbers = value?.toString()?.split(".")?.pop()?.replace(/[^0-9]/g, "") ?? "";
const probablyDate =
only_numbers?.length >= 4 &&
(includesDateNames(column) ||
Expand Down Expand Up @@ -219,7 +219,7 @@ export default function Table({
const indexValue = indexLabel ? row.original[indexLabel] : null;
const value = row.original[column];
const valueType = typeof value;
const only_numbers = value?.toString().replace(/[^0-9]/g, "") ?? "";
const only_numbers = value?.toString()?.split(".")?.pop()?.replace(/[^0-9]/g, "") ?? "";
const probablyDate =
only_numbers?.length >= 4 &&
(includesDateNames(column) ||
Expand Down
Loading

0 comments on commit ae91a3f

Please sign in to comment.