From cf76518bc914b420bac400aad45668ff7a2d21ae Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Tue, 11 Aug 2020 14:31:45 +0800 Subject: [PATCH] time --- static/imservice.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/static/imservice.js b/static/imservice.js index 11a2705..7477d41 100644 --- a/static/imservice.js +++ b/static/imservice.js @@ -299,7 +299,8 @@ IMService.prototype.initialIMListeners = function () { friend.text = message.type != "text" ? "其他消息" : message.payload.text let time = new Date(message.timestamp) friend.date = message.timestamp - friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() + friend.time = (time.getHours() < 10 ? '0' + time.getHours() : time.getHours()) + ":" + (time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()) + ":" + (time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds()) + console.log(that.friends) that.friendsarr = [] for(let i in that.friends){ @@ -325,7 +326,8 @@ IMService.prototype.initialIMListeners = function () { friend.text = message.type != "text" ? "其他消息" : message.payload.text let time = new Date(message.timestamp) friend.date = message.timestamp - friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() + friend.time = (time.getHours() < 10 ? '0' + time.getHours() : time.getHours()) + ":" + (time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()) + ":" + (time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds()) + console.log(this.friends) that.friendsarr = [] for(let i in this.friends){ @@ -424,7 +426,8 @@ IMService.prototype.sendMessagesSetStorage = function (friendId,message){ friend.text = message let time = new Date() friend.date = time.getTime() - friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() + friend.time = (time.getHours() < 10 ? '0' + time.getHours() : time.getHours()) + ":" + (time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()) + ":" + (time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds()) + console.log(that.friends) that.friendsarr = [] for(let i in that.friends){ @@ -448,7 +451,8 @@ IMService.prototype.sendMessagesSetStorage = function (friendId,message){ friend.text = message let time = new Date() friend.date = time.getTime() - friend.time = time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() + friend.time = (time.getHours() < 10 ? '0' + time.getHours() : time.getHours()) + ":" + (time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()) + ":" + (time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds()) + console.log(this.friends) that.friendsarr = [] for(let i in this.friends){