From d1fef48baf90dbd913ecc750889b4456f04b4967 Mon Sep 17 00:00:00 2001 From: Talha Amjad Date: Fri, 29 May 2026 14:17:21 +0500 Subject: [PATCH] fix apply issue --- app/api/dsoc/applications/route.ts | 22 +++++++++++++++++++--- app/dsoc/page.tsx | 2 +- app/dsoc/projects/[id]/page.tsx | 4 ++-- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/api/dsoc/applications/route.ts b/app/api/dsoc/applications/route.ts index 6e71118..a473358 100644 --- a/app/api/dsoc/applications/route.ts +++ b/app/api/dsoc/applications/route.ts @@ -18,11 +18,27 @@ async function getMenteeFromToken(request: NextRequest) { } } -function getDeadlineEnd(dateString: string) { - const [year, month, day] = dateString.split('-').map(Number); +function getDeadlineEnd(dateValue: string | Date) { + if (dateValue instanceof Date) { + return new Date( + dateValue.getFullYear(), + dateValue.getMonth(), + dateValue.getDate(), + 23, + 59, + 59, + 999 + ); + } + + if (typeof dateValue !== 'string') { + return new Date(dateValue as unknown as string); + } + + const [year, month, day] = dateValue.split('-').map(Number); if (!year || !month || !day) { - return new Date(dateString); + return new Date(dateValue); } return new Date(year, month - 1, day, 23, 59, 59, 999); diff --git a/app/dsoc/page.tsx b/app/dsoc/page.tsx index 600469a..e0b4079 100644 --- a/app/dsoc/page.tsx +++ b/app/dsoc/page.tsx @@ -232,7 +232,7 @@ export default function DSOCPage() {
- DSOC 2026 — Applications Open March 2026 + DSOC 2026 — Applications Open May 2026
diff --git a/app/dsoc/projects/[id]/page.tsx b/app/dsoc/projects/[id]/page.tsx index 14c4439..9696f08 100644 --- a/app/dsoc/projects/[id]/page.tsx +++ b/app/dsoc/projects/[id]/page.tsx @@ -733,7 +733,7 @@ export default function ProjectDetailPage({ params }: { params: Promise<{ id: st {project.timelineUrl && ( -
+

@@ -760,7 +760,7 @@ export default function ProjectDetailPage({ params }: { params: Promise<{ id: st )} {/* Discord Card */} -
+

Have Questions?