fix: check if date is invalid

This commit is contained in:
Ahmad Karlam 2020-10-04 10:58:02 +07:00
parent 8c380f118a
commit 29ef90e384

View file

@ -281,6 +281,9 @@ export function convertOnPaste( event = { preventDefault() {} }) {
export function formatTimestamp(sentAt) {
sentAt = new Date(sentAt);
if (isNaN(sentAt)) {
return '';
}
let diffInDays = ((new Date()) - sentAt) / (24 * 3600 * 1000);
if (diffInDays >= 1) {