diff --git a/nextjs-app/components/AdmissionsView.tsx b/nextjs-app/components/AdmissionsView.tsx index db5a500..a63ce86 100644 --- a/nextjs-app/components/AdmissionsView.tsx +++ b/nextjs-app/components/AdmissionsView.tsx @@ -10,7 +10,7 @@ function daysUntil(month: number, day: number): number { today.setHours(0, 0, 0, 0); const y = today.getFullYear(); let target = new Date(y, month - 1, day); - if (target <= today) target = new Date(y + 1, month - 1, day); + if (target < today) target = new Date(y + 1, month - 1, day); return Math.round((target.getTime() - today.getTime()) / 86_400_000); } diff --git a/nextjs-app/components/HomeView.tsx b/nextjs-app/components/HomeView.tsx index 5b9643a..61bc079 100644 --- a/nextjs-app/components/HomeView.tsx +++ b/nextjs-app/components/HomeView.tsx @@ -29,7 +29,7 @@ function daysUntil(month: number, day: number): number { today.setHours(0, 0, 0, 0); const y = today.getFullYear(); let target = new Date(y, month - 1, day); - if (target <= today) target = new Date(y + 1, month - 1, day); + if (target < today) target = new Date(y + 1, month - 1, day); return Math.round((target.getTime() - today.getTime()) / 86_400_000); } @@ -38,7 +38,7 @@ function formatCountdownDate(month: number, day: number): string { today.setHours(0, 0, 0, 0); const y = today.getFullYear(); let target = new Date(y, month - 1, day); - if (target <= today) target = new Date(y + 1, month - 1, day); + if (target < today) target = new Date(y + 1, month - 1, day); return target.toLocaleDateString('en-GB', { weekday: 'short', day: 'numeric', month: 'long', year: 'numeric' }); }