remove some logs, start percent

This commit is contained in:
Tykayn 2024-05-22 11:50:28 +02:00 committed by tykayn
parent 25334bae90
commit 32aff9701e
3 changed files with 39 additions and 17 deletions

View File

@ -31,7 +31,19 @@
</p>
</li>
</ul>
<div class="debug_time_proxy" *ngIf="debug_proxy_time">
Débug du proxy de temps.
On utilise pas directement l'heure actuelle pour comparer les durées afin de rendre le tout testable.
Heure proxy:
{{timeProxy.hour}} :
{{timeProxy.min}}
Heure réelle:
{{now.getHours()}} :
{{timeProxy.min}}
</div>
<div class="pad">
<h2>
@ -182,7 +194,7 @@
</div>
<!-- <p>avancement: {{ getPercentProgressTimeForTopic(subjects[currentSubjectId]) }} %</p>-->
<p>avancement: {{ getPercentProgressTimeForTopic(subjects[currentSubjectId]) }} %</p>
</div>
</div>

View File

@ -156,20 +156,21 @@ main {
}
.left-side{
width: 50%;
.left-side {
width: 21em;
}
.subject {
display: block;
padding: 1rem;
padding: 1rem 1rem 1rem 2rem;
border-left: 10px solid white;
width: 20em;
&.active {
border-left-color: #00b89c;
width: 20em;
word-break: break-all;
word-wrap: break-word;
padding-left: 2rem;
}
}
@ -211,10 +212,11 @@ pre {
}
}
.content-current-subject{
padding-left: 10rem;
box-sizing:border-box;
.content-current-subject {
padding-left: 5rem;
box-sizing: border-box;
}
@media screen and (max-width: 650px) {
.content {
flex-direction: column;

View File

@ -25,6 +25,8 @@ export class AppComponent implements OnInit, OnDestroy {
// startTime: string = "17:00";
endTime: string = "22:00";
now: Date = new Date();
timeProxy: any = {
hour: 10,
min: 30,
@ -144,10 +146,11 @@ export class AppComponent implements OnInit, OnDestroy {
this.startDate = this.makeDateFromHourToday(this.startTime);
this.endDate = this.makeDateFromHourToday(this.endTime);
// let self = this;
// this.interval = setInterval(() => {
// self.updateTopicChangeDate()
// }, 5000)
let self = this;
this.interval = setInterval(() => {
self.now = new Date()
// self.updateTopicChangeDate()
}, 1000)
}
@ -192,13 +195,18 @@ export class AppComponent implements OnInit, OnDestroy {
getPercentProgressTimeForTopic(topic: Topic) {
let now = new Date();
console.log('topic démarré', topic.startDate.getTime())
console.log('topic va se finir', topic.endDate.getTime(), topic.endDate.getTime() - topic.startDate.getTime())
// console.log('topic démarré', topic.startDate.getTime())
// console.log('topic va se finir', topic.endDate.getTime(), topic.endDate.getTime() - topic.startDate.getTime())
return Math.floor((now.getTime() - topic.startDate.getTime()) / (topic.endDate.getTime() - topic.startDate.getTime()) * 100);
}
/**
* clore un sujet, mettre à jour le nombre de secondes passées
* @param currentSubjectId
*/
finishTopic(currentSubjectId: number) {
this.subjects[currentSubjectId].finished = true
this.nextSubject()
}
/**
@ -274,7 +282,8 @@ export class AppComponent implements OnInit, OnDestroy {
}
compteRendu: string = ''
now:Date = new Date();
// now:Date = new Date();
debug_proxy_time: boolean = true;
formatDateYMD(date: Date) {
const year = date.getFullYear();
@ -375,7 +384,6 @@ export class AppComponent implements OnInit, OnDestroy {
let min = Math.min(date1.getTime(),date2.getTime());
let max = Math.max(date1.getTime(),date2.getTime());
let now = new Date().getTime();
console.log('min', min, now , max)
return min < now && max > now;
}
}