|
|
|
|
@ -98,7 +98,7 @@ public slideOptsTwo = {
|
|
|
|
|
spaceBetween: 10
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public timeInSeconds: any = 200;
|
|
|
|
|
public timeInSeconds: any = .15 * 60 * 60;
|
|
|
|
|
public time: any;
|
|
|
|
|
public runTimer = false;
|
|
|
|
|
public hasStarted = false;
|
|
|
|
|
@ -106,8 +106,8 @@ public hasFinished = false;
|
|
|
|
|
public remainingTime: any;
|
|
|
|
|
public displayTime: any;
|
|
|
|
|
public menuEntries: any;
|
|
|
|
|
public titleFormat: any;
|
|
|
|
|
public percent = 10;
|
|
|
|
|
public percent: any = 100 - ((this.timeInSeconds / 32400) * 100);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public ts: TranslatorService,
|
|
|
|
|
@ -137,22 +137,18 @@ public percent = 10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
|
// this.getUserDetails();
|
|
|
|
|
// this.getMenu();
|
|
|
|
|
// this.setServicesPrivilage();
|
|
|
|
|
this.getUserDetails();
|
|
|
|
|
this.getMenu();
|
|
|
|
|
this.setServicesPrivilage();
|
|
|
|
|
|
|
|
|
|
// this.getCount();
|
|
|
|
|
|
|
|
|
|
console.log(this.percent);
|
|
|
|
|
this.initTimer();
|
|
|
|
|
// this.events.subscribe('getNotCount', badge => {
|
|
|
|
|
// this.notBadge = badge;
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// formatSubtitle = (time: number) : string => {
|
|
|
|
|
// return
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
initTimer() {
|
|
|
|
|
this.time = this.timeInSeconds;
|
|
|
|
|
this.runTimer = false;
|
|
|
|
|
@ -175,8 +171,13 @@ timerTick() {
|
|
|
|
|
if (!this.runTimer) { return; }
|
|
|
|
|
this.remainingTime--;
|
|
|
|
|
this.displayTime = this.getSecondsAsDigitalClock(this.remainingTime);
|
|
|
|
|
this.percent = this.percent + 1;
|
|
|
|
|
console.log(this.remainingTime);
|
|
|
|
|
console.log(Math.floor((this.remainingTime / 32400) * 100));
|
|
|
|
|
if (this.remainingTime > 0) {
|
|
|
|
|
const newPercent: any = ((this.remainingTime / 32400) * 100).toFixed(2);
|
|
|
|
|
console.log(newPercent);
|
|
|
|
|
this.percent = 100 - newPercent;
|
|
|
|
|
console.log('umar:' + this.percent);
|
|
|
|
|
this.timerTick();
|
|
|
|
|
} else {
|
|
|
|
|
this.hasFinished = true;
|
|
|
|
|
|