From 9eccabdd174b598538a2f4e8ba893619fdb83345 Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Mon, 6 Sep 2021 17:02:45 +0100 Subject: [PATCH 1/2] save --- src/app/pages/chat/chat.page.ts | 37 +++------------------------------ 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/src/app/pages/chat/chat.page.ts b/src/app/pages/chat/chat.page.ts index 2ec8c44fb..7aebfece6 100644 --- a/src/app/pages/chat/chat.page.ts +++ b/src/app/pages/chat/chat.page.ts @@ -27,6 +27,7 @@ import { EventPerson } from 'src/app/models/eventperson.model'; import { removeDuplicate } from 'src/plugin/removeDuplicate.js' import { environment } from 'src/environments/environment'; import { NotificationsService } from 'src/app/services/notifications.service'; +import { TimeService } from 'src/app/services/functions/time.service'; @Component({ selector: 'app-chat', @@ -117,6 +118,7 @@ export class ChatPage implements OnInit { private storage:Storage, private resolver: ComponentFactoryResolver, private route: Router, + private timeService: TimeService, ){ this.loggedUserChat = authService.ValidatedUserChat['data']; this.headers = new HttpHeaders(); @@ -416,40 +418,7 @@ hideRefreshButton(){ } showDateDuration(start:any){ - let end; - end = new Date(); - start = new Date(start); - let customizedDate; - - const totalSeconds = Math.floor((end - (start))/1000);; - const totalMinutes = Math.floor(totalSeconds/60); - const totalHours = Math.floor(totalMinutes/60); - const totalDays = Math.floor(totalHours/24); - - const hours = totalHours - ( totalDays * 24 ); - const minutes = totalMinutes - ( totalDays * 24 * 60 ) - ( hours * 60 ); - const seconds = totalSeconds - ( totalDays * 24 * 60 * 60 ) - ( hours * 60 * 60 ) - ( minutes * 60 ); - - if(totalDays == 0){ - if(start.getDate() == new Date().getDate()){ - let time = start.getHours() + ":" + this.addZero(start.getUTCMinutes()); - return time; - } - else{ - return 'Ontem'; - } - } - else{ - let date = start.getDate() + "/" + (start.getMonth()+1) + "/" + start.getFullYear(); - return date; - } - } - - addZero(i) { - if (i < 10) { - i = "0" + i; - } - return i; + return this.timeService.showDateDuration(start); } async getChatMembers(){ From 83733aa6d35517f5c808cb0e42c0412ede56615c Mon Sep 17 00:00:00 2001 From: "tiago.kayaya" Date: Tue, 7 Sep 2021 15:19:56 +0100 Subject: [PATCH 2/2] change name after update --- src/app/pages/chat/chat.page.html | 2 +- src/app/shared/chat/edit-group/edit-group.page.ts | 11 ++++++++++- .../chat/group-messages/group-messages.page.html | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/app/pages/chat/chat.page.html b/src/app/pages/chat/chat.page.html index bdfd6a2d0..57c795332 100644 --- a/src/app/pages/chat/chat.page.html +++ b/src/app/pages/chat/chat.page.html @@ -72,7 +72,7 @@ - +
{ + this.room = room['room']; + this.showLoader = false; + this.openGroupMessage.emit(this.room._id); + }); } _ionChange(event){ diff --git a/src/app/shared/chat/group-messages/group-messages.page.html b/src/app/shared/chat/group-messages/group-messages.page.html index db2c8cbe4..54d9bbcbf 100644 --- a/src/app/shared/chat/group-messages/group-messages.page.html +++ b/src/app/shared/chat/group-messages/group-messages.page.html @@ -50,7 +50,8 @@
- Alterou o assunto de para "{{msg.msg.split('-').join(' ')}}"
+ Alterou o nome do grupo para "{{msg.msg.split('-').join(' ')}}"
+ {{last ? scrollToBottom() : ''}}