mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
@@ -49,7 +49,7 @@ export class TimeService {
|
||||
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
|
||||
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
|
||||
|
||||
this.countDownTime = c_day + " : " + c_hours + " : " + c_minutes + " : " + 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);
|
||||
@@ -74,6 +74,39 @@ export class TimeService {
|
||||
return this.countDownTime;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
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(this.room.t === 'p'){
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
else{
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
return this.countDownTime;
|
||||
}
|
||||
|
||||
addZero(i) {
|
||||
if (i < 10) {
|
||||
i = "0" + i;
|
||||
|
||||
Reference in New Issue
Block a user