mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix date
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
<div class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'au' && msg.t != 'ru' && msg.msg !=''" (press)="handlePress(msg._id)">
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name ?? ""}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div class="message">
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
@@ -75,7 +75,7 @@
|
||||
</div>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name ?? ""}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
@@ -96,7 +96,7 @@
|
||||
<div class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' *ngIf="msg.t != 'r' && msg.t != 'ul' && msg.t != 'ru' && msg.file.type != 'application/meeting'" (press)="handlePress(msg._id)">
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name ?? ""}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div class="message">
|
||||
<div *ngIf="msg.attachments" class="message-attachments">
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' (click)="downloadFileMsg(msg)" *ngIf="msg.msg !=''">
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
@@ -64,7 +64,7 @@
|
||||
<!-- <div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' (click)="openPreview(msg)" *ngIf="msg.msg !=''">
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
@@ -77,7 +77,7 @@
|
||||
<div (press)="handlePress(msg._id)" class='message-container incoming-{{msg.u.username!=loggedUser.me.username}}' *ngIf="msg.file.type != 'application/meeting'">
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div *ngIf="msg.attachments" class="message-attachments">
|
||||
|
||||
@@ -6,6 +6,7 @@ import { capitalizeTxt } from 'src/plugin/text'
|
||||
import { NfService } from 'src/app/services/chat/nf.service'
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { showDateDuration } from 'src/plugin/showDateDuration';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -32,6 +33,7 @@ export class MessageService {
|
||||
uploadingFile = false
|
||||
errorUploadingAttachment = false
|
||||
loadHistory = false
|
||||
duration = ''
|
||||
|
||||
constructor(private storage: Storage,
|
||||
private NfService: NfService,
|
||||
@@ -73,6 +75,8 @@ export class MessageService {
|
||||
this.displayType = this.file.type.replace('application/','').toUpperCase()
|
||||
}
|
||||
}
|
||||
|
||||
this.calDateDuration()
|
||||
}
|
||||
|
||||
private usernameToDisplayName(username) {
|
||||
@@ -170,4 +174,8 @@ export class MessageService {
|
||||
|
||||
}
|
||||
|
||||
private calDateDuration(date = null) {
|
||||
this.duration = showDateDuration(date || this._updatedAt);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ export class RoomService {
|
||||
let ChatMessage = _ChatMessage.fields.args[0]
|
||||
|
||||
ChatMessage = this.fix_updatedAt(ChatMessage)
|
||||
console.log('recivemessage', JSON.stringify(_ChatMessage))
|
||||
console.log('recivemessage', ChatMessage)
|
||||
|
||||
const message = this.prepareMessage(ChatMessage)
|
||||
this.lastMessage = message
|
||||
@@ -114,7 +114,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
this.addMessageDB(ChatMessage)
|
||||
|
||||
|
||||
setTimeout(()=>{
|
||||
this.scrollDown()
|
||||
}, 50)
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
</div>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div class="message">
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
@@ -72,7 +72,7 @@
|
||||
</mat-menu>
|
||||
</div>
|
||||
<div class="title">
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div class="message">
|
||||
<div *ngIf="msg.attachments" class="message-attachments">
|
||||
@@ -126,7 +126,7 @@
|
||||
</div>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</div>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
@@ -68,7 +68,7 @@
|
||||
</div>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}} </ion-label>
|
||||
<span class="time">{{showDateDuration(msg.duration)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<div *ngIf="msg.attachments" class="message-attachments">
|
||||
@@ -134,7 +134,7 @@
|
||||
</div>
|
||||
<div class="title">
|
||||
<ion-label>{{msg.u.name}}</ion-label>
|
||||
<span class="time">{{showDateDuration(msg._updatedAt)}}</span>
|
||||
<span class="time">{{msg.duration}}</span>
|
||||
</div>
|
||||
<div>
|
||||
<ion-label>{{msg.msg}}</ion-label>
|
||||
|
||||
Reference in New Issue
Block a user