Browse Source

修复时间显示的bug

master
xie.bx 3 years ago
parent
commit
fe2f3b11e4
  1. 1
      im-ui/src/components/chat/ChatPrivateVideo.vue
  2. 4
      im-ui/src/components/chat/ChatTime.vue

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>

4
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();

Loading…
Cancel
Save