React Calendar Component for Events (Masterclasses & Bootcamps)
This CalendarComponent is a fully functional React-based calendar UI that visually displays scheduled events like Masterclasses and Bootcamps, with an intuitive design, date navigation, and detailed event listing panel. Built with Tailwind CSS, Lucide Icons, and custom utilities (instead of libraries like date-fns), this component is responsive and user-friendly.
β
Key Features
- Event Calendar View
Displays a monthly calendar with:
Dynamic month navigation (<<, >> buttons).
Colored highlights for days with events.
π Green β Masterclass
π Purple β Bootcamp
Gradient β Both on same day
Todayβs date is auto-highlighted with blue.
- Event Sidebar
On date selection, the right panel shows:
All events on the selected day.
Each event includes:
Event type (Masterclass / Bootcamp)
Title and time
A Join Meeting button (opens meeting link in new tab)
Graceful handling for days with no events
- Navigation
Users can move to the previous or next month using Chevron icons.
Events dynamically change based on the selected month/year.
- Data Handling
Uses a dummyEvents object structured as:
ts
Copy
Edit
{
"yyyy-mm-dd": Event[]
}
Efficient date filtering using utility functions (no date-fns/dayjs).
- Utility Functions
Includes clean implementations of:
addMonths, addDays
startOfMonth, endOfMonth, startOfWeek, endOfWeek
formatDate, isSameDay, isSameMonth, isToday, isBefore
π§ How it Works
Matrix Generation:
getMonthMatrix() generates a 6x7 grid (weeks Γ days) to display dates for the current month including previous/next month's overlapping dates.
Event Detection:
getEventDatesForMonth() returns which days have masterclass or bootcamp events.
Event Display:
On day selection, events are shown with clickable links styled by type.
Meeting links are dynamically enabled or disabled.
π¨ Tech Stack Used
React (Functional components + Hooks)
Tailwind CSS for styling
Lucide-react icons (ChevronLeft, ChevronRight, ExternalLink)
Custom date utilities (pure JS)
π Potential Use Cases
Educational platforms (like cohort-based learning apps)
Internal company event schedulers
Webinars / Online workshop managers
Hybrid team meeting dashboards