# 6145 MINCalendar Events
# 61
45 MIN
Overview
Build a calendar that renders events on their days, supports selecting a day, and lets you add and delete events — practicing state management and data transformation keyed by absolute date strings.
Requirements
- Select a day by clicking it, highlighting the selected cell.
- Show the events of the selected day in a panel below the calendar, including a heading with the selected date.
- Add a new event to the selected day via a text input and an "Add" button; empty or whitespace-only titles are ignored.
- Delete an event from the selected day via its delete button.
- Show a "no events" message for a selected day without events.
- Keep events intact when navigating between months (events are keyed by absolute
YYYY-MM-DDdates, independent of the visible month). - Show an event dot on every day that has at least one event; a day with several events shows several dots.
Notes
Components.tsxandutils.tsare read-only — the calendar grid, theDaycells (which render the event dots from each cell'seventCount), and the month-grid logic are already wired.- The starter
App.tsxalready handles month navigation. Your job is the events state:events, the selected day, filtering, and add/delete. utils.tsexportsbuildMonthDays(date, events)(returns cells withdateandeventCount) andtoISODate(date). Pass youreventsstate tobuildMonthDaysinstead of[]— the dots then appear automatically.EventsPanelis a prop-driven component — its starter markup is hardcoded, so inspect it to figure out which props it needs.- Filter events per day by comparing each event's
dateto the selected day; this keeps events stable across month navigation. - Give each new event a unique
id(e.g.crypto.randomUUID()). - Some tests pass right away (empty state) — that's expected; the rest cover add, delete, selection, and persistence across months.
Tests
- does not show dots on a day without events
- selecting a day highlights it
- shows the selected date in the panel heading
- adds a new event via the Add button
- adds a new event when pressing Enter
- ignores empty titles when adding
- shows a dot on the day of a newly added event
- supports multiple events on the same day
- shows only the events of the selected day
- deletes an event from the selected day
- keeps events when navigating between months