forked from EVOgeek/Vmeda.Online
		
	MOBILE-4088 timeline: Don't filter courses, can contain activities due
This commit is contained in:
		
							parent
							
								
									be28e1c2e4
								
							
						
					
					
						commit
						2dcb3895fa
					
				| @ -13,7 +13,6 @@ | |||||||
| // limitations under the License.
 | // limitations under the License.
 | ||||||
| 
 | 
 | ||||||
| import { Component, OnInit } from '@angular/core'; | import { Component, OnInit } from '@angular/core'; | ||||||
| import { CoreTimeUtils } from '@services/utils/time'; |  | ||||||
| import { CoreSites } from '@services/sites'; | import { CoreSites } from '@services/sites'; | ||||||
| import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; | import { CoreBlockBaseComponent } from '@features/block/classes/base-block-component'; | ||||||
| import { AddonBlockTimeline } from '../../services/timeline'; | import { AddonBlockTimeline } from '../../services/timeline'; | ||||||
| @ -171,11 +170,8 @@ export class AddonBlockTimelineComponent extends CoreBlockBaseComponent implemen | |||||||
|      * @return Promise resolved when done. |      * @return Promise resolved when done. | ||||||
|      */ |      */ | ||||||
|     protected async fetchMyOverviewTimelineByCourses(): Promise<void> { |     protected async fetchMyOverviewTimelineByCourses(): Promise<void> { | ||||||
|         const courses = await CoreCoursesHelper.getUserCoursesWithOptions(); |         // Do not filter courses by date because they can contain activities due.
 | ||||||
|         const today = CoreTimeUtils.timestamp(); |         this.timelineCourses.courses = await CoreCoursesHelper.getUserCoursesWithOptions(); | ||||||
| 
 |  | ||||||
|         this.timelineCourses.courses = courses.filter((course) => |  | ||||||
|             (course.startdate || 0) <= today && (!course.enddate || course.enddate >= today)); |  | ||||||
| 
 | 
 | ||||||
|         if (this.timelineCourses.courses.length > 0) { |         if (this.timelineCourses.courses.length > 0) { | ||||||
|             this.courseIds = this.timelineCourses.courses.map((course) => course.id); |             this.courseIds = this.timelineCourses.courses.map((course) => course.id); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user