Browse Source

fix: check if date is invalid

pull/213/head
Ahmad Karlam 5 years ago
parent
commit
29ef90e384
  1. 3
      webroot/js/utils/chat.js

3
webroot/js/utils/chat.js

@ -281,6 +281,9 @@ export function convertOnPaste( event = { preventDefault() {} }) { @@ -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) {

Loading…
Cancel
Save