Ver código fonte

修复时间显示的bug

xie.bx 3 anos atrás
pai
commit
fe2f3b11e4

+ 0 - 1
im-ui/src/components/chat/ChatPrivateVideo.vue

@@ -19,7 +19,6 @@
 				 @click="cancel()"></div>
 				<div v-show="state=='CONNECTED'" title="挂断" class="icon iconfont icon-phone-reject reject" style="color: red;"
 				 @click="handup()"></div>
-
 			</div>
 		</div>
 	</el-dialog>

+ 2 - 2
im-ui/src/components/chat/ChatTime.vue

@@ -18,8 +18,8 @@
 				let time = new Date(this.time);
 				let strtime = "";
 				let curTime = new Date();
-				let dayDiff =curTime.getDate() - time.getDate() ;
-				if (time.getDate() === new Date().getDate()) {
+				let dayDiff = Math.floor((curTime.getTime() - time.getTime())/(24*3600*1000)) ;
+				if (dayDiff < 1) {
 					strtime = time.getHours() <= 9 ? "0" + time.getHours() : time.getHours();
 					strtime += ":"
 					strtime += time.getMinutes() <= 9 ? "0" + time.getMinutes() : time.getMinutes();