From 0d39316afe017d4245d8d0a6c1500bbbb23b7d2c Mon Sep 17 00:00:00 2001 From: Bharath Kumar Date: Wed, 14 Aug 2024 12:27:43 +0530 Subject: [PATCH 1/2] added condition on batch in progress' --- .../app-toc-home/app-toc-home.component.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts index 00e599fcca..3272aa6816 100755 --- a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts +++ b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts @@ -751,17 +751,21 @@ export class AppTocHomeComponent implements OnInit, OnDestroy, AfterViewChecked, if (batch && this.currentCourseBatchId) { this.startDate = (_.get(batch, 'startDate')) this.endDate = (_.get(batch, 'endDate')) - const startDateTime = this.startDate && new Date(this.startDate).getTime() - const endDateTime = this.endDate && new Date(this.endDate).getTime() - this.startDateDifference = now - startDateTime - this.endDateDifference = endDateTime - now - if (this.endDateDifference > 0 && this.startDateDifference > 0 && batch.status !== 2) { - return true + if(this.endDate) { + const startDateTime = this.startDate && new Date(this.startDate).getTime() + const endDateTime = this.endDate && new Date(this.endDate).getTime() + this.startDateDifference = now - startDateTime + this.endDateDifference = endDateTime - now + if (this.endDateDifference > 0 && this.startDateDifference > 0 && batch.status !== 2) { + return true + } + return false } - return false + return true } return false - } return false + } + return false } private initData(data: Data) { From be3a5fb099419d37b14063784db7635e96afcdd5 Mon Sep 17 00:00:00 2001 From: Bharath Kumar Date: Wed, 14 Aug 2024 13:58:22 +0530 Subject: [PATCH 2/2] added condition on batch in progress' --- .../app-toc/components/app-toc-home/app-toc-home.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts index 3272aa6816..d9667486ac 100755 --- a/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts +++ b/project/ws/app/src/lib/routes/app-toc/components/app-toc-home/app-toc-home.component.ts @@ -751,7 +751,7 @@ export class AppTocHomeComponent implements OnInit, OnDestroy, AfterViewChecked, if (batch && this.currentCourseBatchId) { this.startDate = (_.get(batch, 'startDate')) this.endDate = (_.get(batch, 'endDate')) - if(this.endDate) { + if (this.endDate) { const startDateTime = this.startDate && new Date(this.startDate).getTime() const endDateTime = this.endDate && new Date(this.endDate).getTime() this.startDateDifference = now - startDateTime @@ -764,7 +764,7 @@ export class AppTocHomeComponent implements OnInit, OnDestroy, AfterViewChecked, return true } return false - } + } return false }