mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
save
This commit is contained in:
@@ -17,7 +17,7 @@ export class TimeService {
|
||||
end = new Date();
|
||||
start = new Date(start);
|
||||
|
||||
const totalSeconds = Math.floor((end - (start))/1000);;
|
||||
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);
|
||||
@@ -75,37 +75,37 @@ export class TimeService {
|
||||
}
|
||||
|
||||
countDownDateTimer(date:any, roomId:string){
|
||||
let timer = setInterval(() =>{
|
||||
let difference = new Date(date).getTime() - new Date().getTime();
|
||||
let c_day = Math.floor(difference/(1000*60*60*24));
|
||||
let c_hours = Math.floor((difference % (1000*60*60*24)) / (1000*60*60));
|
||||
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
|
||||
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
|
||||
// let timer = setInterval(() =>{
|
||||
// let difference = new Date(date).getTime() - new Date().getTime();
|
||||
// let c_day = Math.floor(difference/(1000*60*60*24));
|
||||
// let c_hours = Math.floor((difference % (1000*60*60*24)) / (1000*60*60));
|
||||
// let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
|
||||
// let c_seconds = Math.floor((difference % (1000*60)) / 1000);
|
||||
|
||||
this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
|
||||
// this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
|
||||
|
||||
if(difference < 0) {
|
||||
clearInterval(timer);
|
||||
this.countDownTime = "Expired";
|
||||
let body = { "roomId":roomId, }
|
||||
this.chatService.getRoomInfo(roomId).subscribe(room=>{
|
||||
this.room = room['room'];
|
||||
// if(difference < 0) {
|
||||
// clearInterval(timer);
|
||||
// this.countDownTime = "Expired";
|
||||
// let body = { "roomId":roomId, }
|
||||
// this.chatService.getRoomInfo(roomId).subscribe(room=>{
|
||||
// this.room = room['room'];
|
||||
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
this.ChatSystemService.deleteRoom(roomId)
|
||||
});
|
||||
}
|
||||
else{
|
||||
// if(this.room.t === 'p'){
|
||||
// this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
// this.ChatSystemService.deleteRoom(roomId)
|
||||
// });
|
||||
// }
|
||||
// else{
|
||||
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
this.ChatSystemService.deleteRoom(roomId)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
return this.countDownTime;
|
||||
// this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
// this.ChatSystemService.deleteRoom(roomId)
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
// return this.countDownTime;
|
||||
}
|
||||
|
||||
addZero(i) {
|
||||
|
||||
Reference in New Issue
Block a user