From bba72364ab0b0e01b0a9b24a342a184ebadffd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stef=20Oss=C3=A9?= Date: Thu, 23 May 2024 18:07:24 +0200 Subject: [PATCH] deadline fout weergegeven --- frontend/src/utils/ApiInterfaces.ts | 2 +- frontend/src/utils/BackendInterfaces.ts | 2 +- frontend/src/utils/helper.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/utils/ApiInterfaces.ts b/frontend/src/utils/ApiInterfaces.ts index 157b8767..cbe0def0 100644 --- a/frontend/src/utils/ApiInterfaces.ts +++ b/frontend/src/utils/ApiInterfaces.ts @@ -9,7 +9,7 @@ export interface Course { export interface Project { project_id: number, project_name: string, - project_deadline: string | Date, + project_deadline: string, project_archived: boolean, project_description: string, project_requirements: string, diff --git a/frontend/src/utils/BackendInterfaces.ts b/frontend/src/utils/BackendInterfaces.ts index d69a081d..e753e76e 100644 --- a/frontend/src/utils/BackendInterfaces.ts +++ b/frontend/src/utils/BackendInterfaces.ts @@ -9,7 +9,7 @@ export interface Backend_Course { export interface Backend_Project { id: number, name: string, - deadline: string | Date, + deadline: string, archived: boolean, description: string, requirements: string, diff --git a/frontend/src/utils/helper.ts b/frontend/src/utils/helper.ts index 3398f217..934b2234 100644 --- a/frontend/src/utils/helper.ts +++ b/frontend/src/utils/helper.ts @@ -1,10 +1,10 @@ -export function deadline_to_string(deadline: Date | string){ +export function deadline_to_string(deadline: string){ const deadline_date = new Date(deadline) const hours = String(deadline_date.getHours()).padStart(2, '0'); const minutes = String(deadline_date.getMinutes()).padStart(2, '0'); const day = String(deadline_date.getDate()).padStart(2, '0'); - const month = String(deadline_date.getMonth()).padStart(2, '0'); + const month = String(deadline_date.getMonth() + 1).padStart(2, '0'); return `${hours}:${minutes} - ${day}/${month}/${deadline_date.getFullYear()}`;