'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 ( <>
{/*
Event Schedule
*/}

Upcoming Events

{currentMonth.format("MMMM YYYY")}
{["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"].map((day, index) => ( ))} {Array.from({ length: Math.ceil(daysInMonth.length / 7) }, (_, rowIndex) => ( {daysInMonth.slice(rowIndex * 7, (rowIndex + 1) * 7).map((day, index) => ( ))} ))}
{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}
))} */}
) : ( "" )}

01

  • 05:30 PM - Sun Jan-14 |
  • 180 Schweitzer St, Kitchener, Canada
Thai Pongal 2024

Holy Family Croatian Roman Catholic Parish Hall

{/*
Alex Roberton

UI/UX Designer

Alexys Archer

WP Developer

*/}
Online Tickets

02

  • Apr 14, 2024 |
  • Christ Lutheran Church , Waterloo, ON
AGM

Christ Lutheran Church , Waterloo, ON

{/*
Alex Roberton

UI/UX Designer

Alexys Archer

WP Developer

*/}
Online Tickets

03

  • Jun 22-23, 2024 |
  • Indian & Sri Lankan Food Court, Kitchener, ON.
KW Multicultural Festival

Indian & Sri Lankan Food Court, Victoria Park, Kitchener, ON.

{/*
Alex Roberton

UI/UX Designer

Alexys Archer

Indian & Sri Lankan Food Court, Victoria Park, Kitchener, ON.

*/}
Online Tickets

04

  • 10:00 AM - Sun Jul 7, 2024 |
  • Pinehurst Lake Conservation – Ayr, ON.
TCA Picnic – Potlock

Pinehurst Lake – Sutor Shelter, Ayr, ON

{/*
Alex Roberton

UI/UX Designer

Alexys Archer

WP Developer

*/}
Registration required

05

  • Jul 27-28, 2024 |
  • Waterloo Park, Waterloo, ON.
South Asian Family Sports Day

MEMBERS ONLY

{/*
Alex Roberton

UI/UX Designer

Alexys Archer

Indian & Sri Lankan Food Court, Victoria Park, Kitchener, ON.

*/}
Registration required

06

  • 06:30-08:30 PM - Aug 23, 2023 |
  • Doon Campus, Ontario
Conestoga College Workshop

Conestoga College – WC 241

{/*
Alex Roberton

UI/UX Designer

Alexys Archer

WP Developer

*/}
Online Tickets

07

  • 06:30 AM-08:30 PM - Aug 23, 2023 |
  • Doon Campus, Ontario
Tamil Cultural Nite

TBA

{/*
Alex Roberton

UI/UX Designer

Alexys Archer

WP Developer

*/}
Online Tickets

08

  • 1.00 PM-4.30 PM - Sat Oct 26, 2024 |
  • Waterloo Public Library
TCA – WPL Deepavali Celebrations

John M. Harper Branch 500 Fischer-Hallman Rd N, Waterloo, ON

{/*
Alex Roberton

UI/UX Designer

Alexys Archer

WP Developer

*/}
Online Tickets

09

  • 05:00 PM-09:00 PM - Sat Dec 21, 2024 |
  • RIM Park
Christmas & 2024 Year End Celebration

2001 University Ave E, Waterloo, ON N2K 4K4

{/*
Alex Roberton

UI/UX Designer

Alexys Archer

Indian & Sri Lankan Food Court, Victoria Park, Kitchener, ON.

*/}
Online Tickets
) }