'use client' import Link from 'next/link' import moment from "moment"; import { useState } from "react" export default function UpcomingEventData() { const [isTab, setIsTab] = useState(1) const handleTab = (i) => { setIsTab(i) } const [currentMonth, setCurrentMonth] = useState(moment()); const events = [ { id: 1, date: "Sun Jan-14", time: "05:30 PM", title: "Thai Pongal 2024", url: "#", }, { id: 2, date: "Apr 14, 2024", title: "AGM", url: "#", }, { id: 3, date: "Jun 22-23, 2024", title: "KW Multicultural Festival", url: "#", }, { id: 4, date: "Sun Jul 7, 2024", time: "10:00 AM", title: "TCA Picnic – Potlock", url: "#", }, { id: 5, date: "Jul 27-28, 2024", title: "South Asian Family Sports Day", url: "#", }, { id: 6, date: "Aug 23, 2023", time: "06:30-08:30 PM", title: "Conestoga College Workshop", url: "#", }, { id: 7, date: "Aug 23, 2023", time: "06:30-08:30 PM", title: "Conestoga College Workshop", url: "#", }, { id: 8, date: "Sat Oct 26, 2024", time: "1.00 PM-4.30 PM", title: "TCA – WPL Deepavali Celebrations", url: "#", }, { id: 9, date: "Sat Dec 21, 2024", time: "05:00 PM-09:00 PM", title: "RIM Park", url: "#", }, ]; // Get the start and end of the current month const startOfMonth = currentMonth.clone().startOf("month"); const endOfMonth = currentMonth.clone().endOf("month"); // Generate the calendar days const daysInMonth = []; for (let i = 0; i < startOfMonth.day(); i++) { daysInMonth.push(null); // Adding null for empty days before the start of the month } for (let i = 1; i <= endOfMonth.date(); i++) { daysInMonth.push(moment(currentMonth).date(i)); } // Function to check if a date has an event const getEventForDate = (date) => { const dateString = date?.format("YYYY-MM-DD"); return events.filter(event => event.date === dateString); }; // Function to navigate to the next/previous month const handleMonthChange = (direction) => { setCurrentMonth(currentMonth.clone().add(direction, "months")); }; return ( <>
| {day} | ))}
|---|
| 0 ? "#eac768" : "white", // Highlight event dates
}}
>
{day ? (
{/* Align day number to the right */}
{day.date()}
{/* Display event names if present */}
{/* {getEventForDate(day).map((event, eventIndex) => (
) : (
""
)}
handleEventClick(event.id)} // Add click handler
style={{
backgroundColor: "#007BFF", // Highlight event with a blue color
borderRadius: "5px",
cursor: "pointer"
}}
>
{event.title}
))} */}
|
))}
Holy Family Croatian Roman Catholic Parish Hall
{/*
UI/UX Designer
WP Developer
Christ Lutheran Church , Waterloo, ON
{/*
UI/UX Designer
WP Developer
Indian & Sri Lankan Food Court, Victoria Park, Kitchener, ON.
{/*
UI/UX Designer
Indian & Sri Lankan Food Court, Victoria Park, Kitchener, ON.
Pinehurst Lake – Sutor Shelter, Ayr, ON
{/*
UI/UX Designer
WP Developer
MEMBERS ONLY
{/*
UI/UX Designer
Indian & Sri Lankan Food Court, Victoria Park, Kitchener, ON.
Conestoga College – WC 241
{/*
UI/UX Designer
WP Developer
TBA
{/*
UI/UX Designer
WP Developer
John M. Harper Branch 500 Fischer-Hallman Rd N, Waterloo, ON
{/*
UI/UX Designer
WP Developer
2001 University Ave E, Waterloo, ON N2K 4K4
{/*
UI/UX Designer
Indian & Sri Lankan Food Court, Victoria Park, Kitchener, ON.