Merge pull request #3196 from crazyserver/MOBILE-4008
MOBILE-4088 timeline: Don't filter courses, can contain activities duemain
commit
d446fc2f1c
|
@ -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…
Reference in New Issue