All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[0.3.0] - 2026-10-19
Changed
- Breaking: upgraded EventCalendar from 4.5.1 to 5.17.2. The new CSS Grid layout changes the calendar markup and styles, review custom CSS.
- Breaking: event dates with an offset (
"...Z","...+02:00", encodedDateTimes) are shifted to the calendar'stimeZone(EventCalendar 5.16). UseNaiveDateTimeor settimeZoneto keep displaying them as is. - Breaking: when the JS commands given to a callback attribute contain a
JS.push/2, the default server event ("event_clicked","date_clicked","month_changed") is not pushed. - Breaking: removed the unused
tzdataandmimerldependencies,esbuildis now dev only, and removed the placeholderhellofunction. - All EventCalendar plugins are always loaded, so every view (including
dayGridDay,dayGridWeek,listYear,resourceTimelineYearand customviews) can be used. - The hook only re-applies the options whose value changed, so re-renders no longer reset the date or view the user navigated to.
- The LiveView hook and the static calendar share their option, event and callback handling.
- The main JavaScript bundle also exports the static calendar functions, so importing
calendar_componentloads a single copy of EventCalendar. Bundles target ES2022. - Requires Phoenix LiveView
~> 1.1(tested with 1.2).
Added
on_event_drop,on_event_resizeandon_selectattributes. Drop and resize handlers can reply%{revert: true}to undo the change.- Callback attributes accept a string (server event name) or
false(disable the event) besidesPhoenix.LiveView.JScommands. JS.push/2operations in callback attributes receive the callback payload.- Richer payloads: instants and wall-clock strings for every date,
view,resource,oldEvent, deltas and the event'sresourceIds, colors andextendedProps. CalendarComponent.push_command/4to callgotoDate,next,prev,today,refetchEvents,refetchResources,unselectandsetOptionfrom the server.CalendarComponent.event_calendar_version/0.- Custom toolbar buttons with
push: "event_name"notify LiveView when clicked. - Callback options given as global function references (
"MyApp.Calendar.onClick") in the LiveView calendar, and for every callback option (pluscustomButtons.*.click) in the static calendar. getStaticCalendar/1JavaScript function.initialViewis accepted as an alias ofview, andheaderToolbaracceptsleft/rightas aliases ofstart/end.- JavaScript unit tests (
cd assets && npm test).
Fixed
- The
viewoption was ignored: it was replaced byinitialView, which EventCalendar does not support. - LiveView patches removed the calendar DOM; the container now uses
phx-update="ignore". - JS commands given to callback attributes never ran because they were HTML-escaped.
- An empty
eventslist did not clear the calendar. - Events with
resourceIds(or without resources) were dropped in resource views. month_changedreported the month of the first visible day instead of the displayed month.- Events without
endwere stretched up to the current date; they now last one day (all-day) or one hour. - Static callbacks that could not be resolved were passed to EventCalendar as strings.
- Removed the debug
console.logcalls from the LiveView hook.
[0.1.5] - 2024-12-15
Added
static_calendar/1component for use with regular Phoenix controllers (no LiveView required)- Static calendar JavaScript module for vanilla Phoenix applications
- Support for string-based JavaScript callbacks in static calendar options
- Auto-initialization of static calendars via CSS class selector
- Comprehensive documentation for controller usage
- New exports in JavaScript module for static calendar functions
Changed
- Enhanced component module documentation to cover both LiveView and controller usage
- Updated installation guides with controller-specific examples
- Added controller examples to README
- Improved JavaScript build process to generate both LiveView hooks and static calendar modules
Fixed
- Calendar now works in both LiveView and traditional Phoenix controller contexts
[0.1.4] - 2024-12-15
Added
- ES6 module support for JavaScript hooks
index.jsentry point for easier import in Phoenix applicationspackage.jsonfor npm compatibility- Improved documentation with installation examples
Changed
- JavaScript build format changed from IIFE to ESM for better compatibility
- Updated README with clearer installation instructions
- Simplified hook registration process
Fixed
- JavaScript import issues when using
{:calendar_component, "~> 0.1.9"}in Phoenix apps - Hook accessibility for external applications
[0.1.3] - 2024-12-14
Added
- Initial release of the calendar component
- Phoenix LiveView integration
- EventCalendar JS hooks
- CSS compilation
- Documentation and examples
Features
- Interactive calendar rendering
- Event handling with LiveView callbacks
- Customizable options forwarding to EventCalendar
- Automatic plugin selection based on view type
- CSS and JS asset compilation