TIP

WE'RE HIRING! 💼

The Solspace team is expanding! If you love Craft CMS and you’re looking for an exciting full-time remote position working on software development for the Freeform and Calendar plugins for Craft and more, we’d love to hear from you!

Check Out Job Listing!

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
  • lighterColor #
    • a hex color made lighter by 20%
  • darkerColor #
    • a hex color made darker by 20%
  • contrastColor #
    • either black or white, depending on the darkness or lightness of color
  • 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
Last Updated: 2/3/2020, 5:06:34 PM