From 32aff9701ed7a255945c27dfca2dbb50859e8a26 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Wed, 22 May 2024 11:50:28 +0200 Subject: [PATCH] remove some logs, start percent --- ordre-du-jour/odj2/src/app/app.component.html | 14 ++++++++++- ordre-du-jour/odj2/src/app/app.component.scss | 18 +++++++------- ordre-du-jour/odj2/src/app/app.component.ts | 24 ++++++++++++------- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/ordre-du-jour/odj2/src/app/app.component.html b/ordre-du-jour/odj2/src/app/app.component.html index 3b004845..5e5ca200 100644 --- a/ordre-du-jour/odj2/src/app/app.component.html +++ b/ordre-du-jour/odj2/src/app/app.component.html @@ -31,7 +31,19 @@

+
+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}} +

@@ -182,7 +194,7 @@

- +

avancement: {{ getPercentProgressTimeForTopic(subjects[currentSubjectId]) }} %

diff --git a/ordre-du-jour/odj2/src/app/app.component.scss b/ordre-du-jour/odj2/src/app/app.component.scss index 6a7b1d59..e0ecb18c 100644 --- a/ordre-du-jour/odj2/src/app/app.component.scss +++ b/ordre-du-jour/odj2/src/app/app.component.scss @@ -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; diff --git a/ordre-du-jour/odj2/src/app/app.component.ts b/ordre-du-jour/odj2/src/app/app.component.ts index 54d0aa31..714e92ce 100644 --- a/ordre-du-jour/odj2/src/app/app.component.ts +++ b/ordre-du-jour/odj2/src/app/app.component.ts @@ -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; } }