Merge pull request #2162 from crazyserver/MOBILE-3136
MOBILE-3136 calendar: Fix param pass to day viewmain
commit
92874fbb75
|
@ -108,9 +108,13 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
||||||
AddonCalendarProvider.ALL_TYPES.forEach((name) => {
|
AddonCalendarProvider.ALL_TYPES.forEach((name) => {
|
||||||
this.filter[name] = true;
|
this.filter[name] = navParams.get(name);
|
||||||
|
this.filter[name] = typeof this.filter[name] == 'undefined' ? true : this.filter[name];
|
||||||
});
|
});
|
||||||
this.filter['courseId'] = navParams.get('courseId');
|
this.filter.courseId = navParams.get('courseId');
|
||||||
|
this.filter.categoryId = navParams.get('categoryId');
|
||||||
|
|
||||||
|
this.filter.filtered = this.filter.courseId || AddonCalendarProvider.ALL_TYPES.some((name) => !this.filter[name]);
|
||||||
|
|
||||||
this.year = navParams.get('year') || now.getFullYear();
|
this.year = navParams.get('year') || now.getFullYear();
|
||||||
this.month = navParams.get('month') || (now.getMonth() + 1);
|
this.month = navParams.get('month') || (now.getMonth() + 1);
|
||||||
|
|
|
@ -324,9 +324,9 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy {
|
||||||
year: data.year
|
year: data.year
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.filter.courseId) {
|
Object.keys(this.filter).forEach((key) => {
|
||||||
params.courseId = this.filter.courseId;
|
params[key] = this.filter[key];
|
||||||
}
|
});
|
||||||
|
|
||||||
this.navCtrl.push('AddonCalendarDayPage', params);
|
this.navCtrl.push('AddonCalendarDayPage', params);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue