"use client"; import { motion } from "framer-motion"; import { Card, CardBody, Image, Chip } from "@heroui/react"; import { useEffect, useState } from "react"; import { fontCursive, fontSans, fontMono } from "@/config/fonts"; import { HeartFilledIcon, CalendarIcon } from "@/components/icons"; const importantDates = [ { title: "The Proposal", date: "15th March 2025", note: "The day the proposal happened with a ring.", image: "/Images/19.jpg", }, { title: "The Patipatra", date: "18th April 2025", note: "Our families came up with a holy date.", image: "/Images/Patipatra.jpeg", }, { title: "Our Engagement", date: "23rd November 2025", note: "A promise sealed with love and laughter.", image: "/Images/22.jpg", }, { title: "Wedding Bells", date: "23rd January 2026", note: "Two souls, one journey begins.", image: "/Images/21.jpg", }, { title: "Reception", date: "25th January 2026", note: "Celebrating our union with friends and family.", image: "/Images/20.jpg", }, ]; export default function DatesPage() { const [now, setNow] = useState(null); useEffect(() => { setNow(new Date()); }, []); const parseDate = (dateStr: string) => { const cleaned = dateStr.replace(/(\d+)(st|nd|rd|th)/, "$1"); return new Date(cleaned); }; return (
{/* Header */}
Our Journey

Mark the Dates

"Every moment led us here. From the first proposal to the final vows, follow the milestones of our love story."

{/* Timeline Grid */}
{/* Timeline Line (Center - Desktop only) */}
{importantDates.map((item, index) => { const eventDate = parseDate(item.date); // Mark as completed only after one full day has passed (24 hours after end of day) const completionThreshold = new Date(eventDate); completionThreshold.setDate(completionThreshold.getDate() + 1); completionThreshold.setHours(23, 59, 59, 999); const isPast = now ? now > completionThreshold : false; const isLeft = index % 2 === 0; return ( {/* Content Side */}
{isPast && ( Completed )}

{item.date}

{item.title}

{item.note}

{/* Center Icon (Desktop only) */}
{isPast ? ( ) : ( )}
{/* Image Side */}
{item.title}
); })}
{/* Bottom Call to Action */}

Counting down the days...

); }