Skip to content

Commit

Permalink
Merge pull request #606 from sunbird-cb/survey
Browse files Browse the repository at this point in the history
TOC progress bar condition updated
  • Loading branch information
christyfernandes authored Nov 11, 2022
2 parents c1372f8 + bb59297 commit a1dd06f
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,22 +350,23 @@ export class AppTocHomeComponent implements OnInit, OnDestroy, AfterViewChecked,
} return 'NA'
}
get isBatchInProgress() {
if (this.content && this.content['batches']) {
// if (this.content && this.content['batches']) {
// const batches = this.content['batches'] as NsContent.IBatch
if (this.currentCourseBatchId) {
const now = moment()
const batch = _.first(_.filter(this.content['batches'], { batchId: this.currentCourseBatchId }) || [])
if (batch) {
return (
// batch.status &&
moment(batch.startDate).isSameOrBefore(now)
&& moment(batch.endDate || new Date()).isSameOrAfter(now)
)
if (this.batchData && this.batchData.content) {
const batch = _.first(_.filter(this.batchData.content, { batchId: this.currentCourseBatchId }) || [])
if (batch) {
return (
// batch.status &&
moment(batch.startDate).isSameOrBefore(now)
&& moment(batch.endDate || new Date()).isSameOrAfter(now)
)
}
return false
}
return false
}
return false
} return false
} return false
}
private initData(data: Data) {
const initData = this.tocSvc.initData(data, true)
Expand Down

0 comments on commit a1dd06f

Please sign in to comment.