diff --git a/FU.SPA/src/components/PostCard.jsx b/FU.SPA/src/components/PostCard.jsx index 8b35a23d..50939036 100644 --- a/FU.SPA/src/components/PostCard.jsx +++ b/FU.SPA/src/components/PostCard.jsx @@ -8,10 +8,14 @@ import { } from '@mui/material'; const PostCard = ({ post }) => { - const dateTimeString = new Date(post.startTime).toLocaleString('en-US', { - dateStyle: 'medium', - timeStyle: 'short', - }); + let dateTimeString = 'Unspecified time'; + + if (post.startTime) { + dateTimeString = new Date(post.startTime).toLocaleString('en-US', { + dateStyle: 'medium', + timeStyle: 'short', + }); + } return (