From aa351fe5b16e223c4b1adce46892825ec3f4dc6e Mon Sep 17 00:00:00 2001 From: Bram Meir Date: Sat, 23 Mar 2024 21:47:20 +0100 Subject: [PATCH 1/7] chore: filter on deadline --- frontend/src/views/calendar/CalendarView.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/calendar/CalendarView.vue b/frontend/src/views/calendar/CalendarView.vue index fdf4cd4d..0fc423f1 100644 --- a/frontend/src/views/calendar/CalendarView.vue +++ b/frontend/src/views/calendar/CalendarView.vue @@ -2,6 +2,7 @@ import moment from 'moment'; import 'moment/dist/locale/nl'; import BaseLayout from '@/components/layout/BaseLayout.vue'; +import ProjectLink from '@/components/projects/ProjectLink.vue'; import Calendar from 'primevue/calendar'; import Title from '@/components/Title.vue'; import { useProject } from '@/composables/services/project.service'; @@ -24,14 +25,22 @@ const { projects, getProjectsByStudent } = useProject(); // TODO: Set correct user ID const loadProjects = async () => { - await getProjectsByStudent("1"); + await getProjectsByStudent("000210394313"); }; +const projectsWithDeadline = computed(() => { + // Filter the projects with the selected date + return projects.value?.filter(project => { + return moment(project.deadline).isSame(moment(selectedDate.value), 'day'); + }); +}); + /* Load the projects when the component is mounted */ onMounted(() => { loadProjects(); }); +