Skip to content

Commit

Permalink
Merge pull request #1357 from AletheiaFact/work-aroud-formatPublicati…
Browse files Browse the repository at this point in the history
…onDate

Provisory WorkAround to Format Publication Date.
  • Loading branch information
thesocialdev authored Aug 20, 2024
2 parents 3334a0f + 31b8f97 commit dca145d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ const VerificationRequestList = () => {
[]
);

const formatPublicationDate = (dateString) => {
const publicationDate = new Date(dateString);
const isValidDate = !isNaN(publicationDate.getTime());

return isValidDate ? publicationDate.toLocaleDateString() : dateString;
};

const columns = React.useMemo<GridColDef[]>(
() => [
{
Expand Down Expand Up @@ -84,7 +91,7 @@ const VerificationRequestList = () => {
flex: 1,
valueGetter: (value, row) =>
row.publicationDate
? new Date(row.publicationDate).toLocaleDateString()
? formatPublicationDate(row.publicationDate)
: "",
},
{
Expand Down

0 comments on commit dca145d

Please sign in to comment.