$ show antoniandre/vue-cal
Vue Cal is a full-featured Vue 3 calendar component library with zero external dependencies beyond Vue itself. It provides multiple views (day, week, month, year, years), event management (create, edit, delete, drag-and-drop, resize), schedules, special hours, extensive localization (50+ languages), dark/light theme via CSS variables, and comprehensive slot-based customization. The library is built entirely with the Composition API and is structured around core composables: `useVueCal` (main state), `useConfig` (prop parsing, locale loading), `useEvents` (event normalization, indexing, overlap detection), `useView` (navigation, cell generation), and `useDragAndDrop` (native HTML5 DnD with cross-instance support). The primary entry point is `src/vue-cal/index.js`, which exports the `VueCal` component, `useLocale` function, and a set of optional Date prototype extensions. Events are passed as an array of objects and reactively rendered; all interactions emit Vue events enriched with context (cell info, cursor position). The library is in active pre-release (v5.0.1-rc.46) with a stable release pending timezone support.
The LLM identified 4 files worth highlighting for reuse:
Implements native HTML5 drag-and-drop for calendar events with cross-instance support (drag from one VueCal to another). Handles drag start/over/end, ghost elements, snap-to-interval, and rejection via event listeners. Isolated from the rest of the codebase except for injected VueCal instance. Could be extracted as a standalone DnD composable for any grid-based UI.
Provides event normalization, indexing by year/month/day, overlap detection (assigns column positions and maxConcurrent), and resize handling. Uses a fast path for <100 events. The overlap algorithm is self-contained and could be reused in any calendar or scheduling application that needs to stack overlapping time intervals.
Manages view state, navigation (next/previous/switch), cell generation for all view types, and now-line positioning. Contains date range calculations (start/end of week, month, year) that are independent of Vue. Could be extracted as a pure date navigation utility for any calendar project.
Provides a comprehensive set of date manipulation functions (addDays, format, formatTime, isSameDay, etc.) and an optional `addDatePrototypes()` that injects these methods onto native Date.prototype. While prototype extension is controversial, the utility functions themselves are clean, well-tested (via usage), and could be extracted as a standalone date helper library.