panhui 3 năm trước cách đây
mục cha
commit
5dce613e93
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      src/plugins/chat.js

+ 5 - 1
src/plugins/chat.js

@@ -186,9 +186,13 @@ function getPushMsg(msgs, oldMsgs = []) {
 
     let _back = [...msgs, ...oldMsgs]
         .map(item => {
+            let _createdAt = '';
+            if (item.createdAt) {
+                _createdAt = item.createdAt.replace(/-/g, '/');
+            }
             return {
                 ...item,
-                time: item.time || new Date(item.createdAt)
+                time: item.time || new Date(_createdAt)
             };
         })
         .sort((a, b) => {