> ## Documentation Index
> Fetch the complete documentation index at: https://committ.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Calendar Store

> Calendar grid state, view modes, date selection, and drag-drop tracking.

# Calendar Store

The useCalendarStore manages all state for the calendar grid and event interaction system.

***

## State Shape

| Field           | Type           | Purpose                                                     |
| :-------------- | :------------- | :---------------------------------------------------------- |
| selectedDate    | string         | Currently focused date (ISO string)                         |
| viewMode        | string         | Calendar grid display mode (day or week)                    |
| selectedEventId | string or null | ID of the event the user tapped (triggers EventDetailModal) |
| selectedEvent   | object or null | Full event data for the selected event                      |
| isDragging      | boolean        | Whether a drag-and-drop operation is in progress            |

***

## Key Actions

* setSelectedDate(date) -- Updates the focused date, triggering CalendarKit to scroll to that date
* setSelectedEvent(event) -- Sets the event data and opens the EventDetailModal
* clearSelection() -- Closes the EventDetailModal and clears selection state
* setViewMode(mode) -- Switches between day and week view
