Timestamp: Eliminate 'Invalid date' from potential output
This commit is contained in:
@@ -7,7 +7,7 @@ import { formatRelativeTime } from '../../util/formatRelativeTime';
|
||||
import { Localizer } from '../../types/Util';
|
||||
|
||||
interface Props {
|
||||
timestamp: number;
|
||||
timestamp: number | null;
|
||||
extended: boolean;
|
||||
module?: string;
|
||||
withImageNoCaption?: boolean;
|
||||
@@ -52,6 +52,10 @@ export class Timestamp extends React.Component<Props> {
|
||||
} = this.props;
|
||||
const moduleName = module || 'module-timestamp';
|
||||
|
||||
if (timestamp === null || timestamp === undefined) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<span
|
||||
className={classNames(
|
||||
|
Reference in New Issue
Block a user