This document is for an older version of
Calendar
.
View latest version →
Calendar object
Properties
id
#- the calendar's unique ID
name
#- the calendar's name
handle
#- the calendar's handle
color
#- a hex color code, e.g.
#FF00FF
- a hex color code, e.g.
lighterColor
#- a hex color made lighter by 20%
darkerColor
#- a hex color made darker by 20%
contrastColor
#- either
black
orwhite
, depending on the darkness or lightness ofcolor
- either
icsUrl
#- displays the full ICS subscription URL that users can subscribe to in their calendaring system such as Apple Calendar or Google Calendar, if ICS sharing is enabled for this calendar (enabled inside Calendars page of Calendar CP).
icsHash
#- displays the ICS subscription hash (not the full ICS URL) that for users to subscribe to calendars.
Usage in Templates
{% set calendar = craft.calendar.calendar({
handle: "holidays"
}) %}
{% if calendar %}
<div style="color: {{ calendar.color }};">
{{ calendar.name }}
</div>
{% endif %}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9