pagination

This commit is contained in:
briannelson95
2025-07-02 20:33:23 -04:00
parent 95f8dfe2ab
commit e6e24f12d4
9 changed files with 211 additions and 30 deletions

View File

@@ -0,0 +1,13 @@
export function getDaysUntilEvent(eventDate: Date): number {
const today = new Date();
const target = new Date(eventDate);
// Clear time from both dates to ensure accurate full-day difference
today.setHours(0, 0, 0, 0);
target.setHours(0, 0, 0, 0);
const diffInMs = target.getTime() - today.getTime();
const diffInDays = Math.ceil(diffInMs / (1000 * 60 * 60 * 24));
return diffInDays;
}