This guide explains how to create and manage calendars in Discourse using the Calendar (and Event) plugin.
Required user level: All users
Calendars are a powerful feature in Discourse that allow you to organize and display events within your community. This guide will walk you through the process of creating calendars, adding events, and managing them effectively.
Summary
- Enable the Calendar plugin
- Create a calendar in a topic or category
- Add events to your calendar
- Manage calendar options and settings
- Use the holiday calendar feature
Enabling the Calendar plugin
Before you can create calendars, ensure that the “Calendar (and Event)” plugin is enabled on your Discourse instance. For more details on enabling the plugin and its related settings, refer to the Discourse Calendar and Event plugin documentation.
Creating a calendar
Topic calendar
To embed a calendar in a topic:
- Create a new topic or edit the first post of an existing topic
- Add the following code on separate lines:
[calendar] [/calendar]
- Publish or update the post
Monday is considered the first day of the week in Discourse calendars, regardless of the viewer’s locale settings. This is currently not configurable.
Category calendar
To create a category-wide calendar:
- Go to
/admin/site_settings/category/discourse_calendar?filter=plugin=discourse-calendar
- In the “calendar categories” setting, add an entry with the following format:
categoryId=123;postId=4949;tzPicker;defaultView=month
- Replace
123
with your category ID (found in the URL when viewing the category) - Replace
4949
with the post ID of the category description (found by appending.json
to the “About category” topic URL)
- Replace
- Add the category ID to the “events calendar categories” setting
- Optionally, set “discourse post event allowed on groups” to control which groups can add events
Adding items to a calendar
Topic calendar
To add an event to a topic calendar:
- Reply to the topic containing the calendar
- Use the Insert Date function in the composer to add a date or date range
- Add a description above the date
- Submit the reply
The event will appear in the calendar after reloading the topic.
Category calendar
To add an event to a category calendar:
- Create a new topic in the category
- Click the gear button and select “Create event”
- Fill in the event details and publish
The event will appear on the category calendar.
Calendar options
You can customize your calendar using various options:
Option | Example | Description |
---|---|---|
Hide weekends | weekends="false" |
Hides Saturday and Sunday |
Hide specific days | hiddenDays="1,2" |
Hides Monday and Tuesday (use 0-6 for Sunday-Saturday) |
Set default view | defaultView="basicWeek" |
Options: month , basicWeek , listNextYear
|
Ignore timezones | fullDay="true" |
Treats all events as full-day events |
Example usage:
[calendar weekends="false" hiddenDays="1,2" defaultView="basicWeek" fullDay="true"]
[/calendar]
Removing calendar items
Calendar items cam be removed in these ways:
- Expired calendar items can be automatically removed using the “delete expired event posts after” setting
- Use topic timers to auto-delete replies
- Manually delete posts as needed
Holiday calendar
The holiday calendar is a special feature for managing site staff holidays:
- Create a topic with a calendar in the first post
- Set the “holiday calendar topic id” to the ID of this topic
- Replies to this topic will be treated as vacation time for the posting user
- Vacation entries are automatically and randomly colored
- An emoji (default: ) appears next to vacationing users’ names in user cards and @mentions
- Optionally, include locale-specific holidays for users by enabling “calendar automatic holidays enabled”
FAQs
Q: Why do some events appear to span multiple days?
A: The calendar is always in UTC. Use the “all day event start time” and “all day event end time” settings to adjust for timezone differences.
Q: Can I control the colors of holiday calendar entries?
A: Currently, it’s not possible to control the colors of holiday calendar entries or get colored entries in regular calendars.
Q: How do I display past events in a list view?
A: There’s currently a bug when using defaultView=listNextYear
that causes the initial view to be empty. As a workaround, users need to switch to monthly view, go back one month, and then return to list view to see past events.
Additional resources
Last edited by @hugh 2024-07-02T09:35:06Z
Last checked by @hugh 2024-07-02T09:35:23Z
Check document
Perform check on document: