You can use the craft.calendars.month variable to produce a monthly calendar.

This variable returns a CalendarMonthModel object.


A CalendarMonthModel is an object that represents a calendar month, as well as a query for events that occur during the month.

This makes it easy to find all of the events in a month and display them in a grid layout or weekly list.

{% set month = craft.calendars.month
.weekStartDay('Sunday') %}

Adding parameters to the CalendarMonthModel changes:


A CalendarMonthModel accepts the same parameters as an EventCriteriaModel object.

(In other words, you can use all the parameters with calendars.month that you can use with the variable.)

CalendarMonthModel also has some additional month-specific parameters:


The date from which the monthly calendar will be generated. (The generated monthly calendar will include the dates from the month in which calendarDay falls, plus any leading or trailing days at the beginning/end of the included weeks.) Accepts a DateTime object or a date string.


The day of the week on which to start the weeks of the calendar. Accepts a string: the full name of the weekday.


Whether or not to include the EventModel objects for events that fall within the dates of the computed calendar. (This is set to true by default, but if you only need the calendar, without any events, you can disable it to improve performance.) Accepts a boolean.

Excluding Events

By default, when you fetch a CalendarMonthModel using calendars.month, Craft Calendars automatically creates a corresponding EventCrtieriaModel (based on the parameters you provide), fetches any matching events that occur during the month, and attaches them to the CalendarMonthModel.

However, you can use a CalendarMonthModel to create a calendar view for any arbitrary month, whether or not is has Craft Calendars events attached.



The number of days in the given month.


A DateTime representing the beginning of the given month.


A DateTime representing the beginning of the next month.


A DateTime representing the beginning of the previous month.


A DateTime representing the first day on the calendar, including leading days from the previous month.


A DateTime representing the first day on the calendar, including trailing days from the next month.


A list of abbreviations of the week days, in order. (The order of week days changes based on the weekStartDay parameter you provide.)

Each item is an array with weekday (“Sunday”), weekdayShort (“Sun”), and weekdayFirst (“S”) properties.


An array list of the weeks in the month.

(This is the property you would loop through to create the ‘rows’ of a calendar grid view.)

Each item of weeks has a single property: days.

Items in the days array represents days in the week. Each day has these properties:

(These properties are described in detail below.)

Properties of days


A DateTime representing the calendar day.


A boolean representing whether the calendar day is a leading day from the previous month.


A boolean representing whether the calendar day is part of the given month.


A boolean representing whether the calendar day is a trailing day from the next month.


A boolean representing whether the calendar day is the given day from which the month was generated.


A boolean representing whether the calendar day is today.


A list of EventModel objects, representing the events that occur on the calendar day.

This property will be empty if you have chosen to exclude events by setting withEvents to false.

Example Template

You can use this example template as a starting point to create a table-based calendar grid:

{# First, we pull a CalendarMonthModel #}
{# by invoking craft.calendars.month #}
{% set params = {
calendarDay: 'today',
weekStartDay: "Sunday",
} %}
{% set month = craft.calendars.month(params) %}
{# Now `month` is a CalendarMonthModel #}
{# We can use the `weekdays` property #}
{# to create the calendar header. #}
{% for day in month.weekdays %}
<th>{{ day.weekdayFirst }}</th>
{% endfor %}
{# Then we loop through the `weeks` and `days` #}
{# to output the events. #}
{% for week in month.weeks %}
{% for day in week.days %}
isPrev: {{ day.isPrevMonth }}
isNext: {{ day.isNextMonth }}
isCurrent: {{ day.isCurrentMonth }}
isGiven: {{ day.isGivenDay }}
isToday: {{ day.isToday }}
Date: {{ | date('Y-m-d') }}
Event Count: {{ | length }}
{% endfor %}
{% endfor %}