[O] Filter out courses not from this year

This commit is contained in:
Hykilpikonna
2020-04-12 14:50:21 -04:00
parent cd14b2a768
commit 87a3aed16d
@@ -46,6 +46,7 @@
import {Component, Prop, Vue} from 'vue-property-decorator'
import App from '@/components/app/app';
import CourseInfo from '@/logic/course-info';
import {GPAUtils} from '@/logic/utils/gpa-utils';
@Component
export default class CourseSelection extends Vue
@@ -81,8 +82,12 @@
get filteredCourses()
{
return this.courseInfo.filter(c => c.name.toLowerCase().includes(this.search))
.filter(c => c.level !== 'Club');
let year = GPAUtils.getSchoolYear();
return this.courseInfo.filter(c =>
c.name.toLowerCase().includes(this.search) &&
c.level !== 'Club' &&
c.year == year);
}
}
</script>