Calendar
A full-featured event calendar with month and week views, event chips, selectable dates, event-detail popovers, week numbers, and a complete JavaScript navigation API.
Full-featured Calendar with Popovers
Click any event chip to open a detail popover. Month / Week view switcher and Today navigation in the header. Events on the same day stack; overflow shows a "+N more" badge.
Week View
The week view shows a single 7-day strip with full-day event chips. Navigates one week at a time.
With ISO Week Numbers
ISO 8601 week numbers in a narrow gutter on the left. Useful for production schedules and editorial planning.
Selectable with Date Constraints
Restrict which dates can be selected with minDate() and
maxDate(). Disabled dates render at reduced opacity. The selected
date is reported below.
Read-only Display
Without selectable(), the calendar is a pure display widget —
no hover cursor, no selection state. Ideal for embedding on public-facing pages.
PHP PHP Methods (Fluent)
| Method / Property | Parameters | Description |
|---|---|---|
$m->calendar($id) | string $id | Create a Calendar instance. |
->events($events) | array | Set all events. Each event: date (YYYY-MM-DD, required), title, type, color, description, url. |
->addEvent($event) | array | Append a single event. |
->view($view) | string | Initial view. Default: 'month'. Accepted: 'month', 'week'. |
->initialDate($date) | string YYYY-MM-DD | Date to display on first render. Defaults to today. |
->selectable() | bool = true | Allow clicking dates. Fires m:calendar:dateclick. |
->highlightToday() | bool = true | Fill today's date number with a primary-colour circle. Default: on. |
->weekStartsMonday() | bool = true | Start columns on Monday instead of Sunday. |
->showWeekNumbers() | bool = true | Show ISO 8601 week numbers in the left gutter. |
->withPopover() | bool = true | Show an event-detail popover when an event chip is clicked. |
->minDate($date) | string YYYY-MM-DD | Earliest date that can be viewed or selected. |
->maxDate($date) | string YYYY-MM-DD | Latest date that can be viewed or selected. |
->height($css) | string | Fixed height for calendar rows (e.g. '200px'). Default: fluid. |
JS JS Methods
| Method / Property | Parameters | Description |
|---|---|---|
m.calendar(id) | | Get the Calendar API instance. Returns null if element not found. |
.view('month'|'week') | string | Switch the current view and re-render. |
.goTo(dateStr) | string YYYY-MM-DD | Navigate to the period containing the given date. |
.today() | | Jump to today's month. |
.prev() | | Navigate back one month (or one week in week view). |
.next() | | Navigate forward one month (or one week in week view). |
.setEvents(events) | Array | Replace all events and re-render. |
.addEvent(event) | Object | Append one event and re-render. |
.clearEvents() | | Remove all events and re-render. |
.selected() | | Returns the currently selected date string (YYYY-MM-DD), or null. |
EVENT Events
| Event Name | Detail | Description |
|---|---|---|
m:calendar:dateclick | { date, events } | Fired when a selectable date cell is clicked. date is YYYY-MM-DD; events is the array of events on that day. |
m:calendar:eventclick | { event, date } | Fired when an event chip is clicked. event is the full event object. |
m:calendar:navigate | { year, month, view } | Fired after the calendar navigates to a new period. |