Discourse Calendar

:discourse2: Summary Discourse Calendar gives the ability to create a dynamic calendar in the first post of a topic. New calendar items can be added by posting a reply with a date using the “Insert Date” modal.
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-calendar
:open_book: Install Guide How to install plugins in Discourse

Features

To embed the calendar, add the following BBCode (note the separate lines) in the first post of a topic:

[calendar]
[/calendar]

Optionally you can hide weekends and other days with special attributes. Hidden days are 0 to 6 for Sunday to Saturday respectively. As currently implemented, Monday is the first day of every week, regardless of the viewer’s locale settings and this is not currently configurable.

You can also set the default view to:

  • Month (month)
  • Week (basicWeek), which shows days in columns
  • List (listNextYear) which lists all entries in the next year.

In addition, you can ignore timezones by setting fullDay attribute.

For example:

[calendar weekends="false" hiddenDays="1,2" defaultView="listNextYear" fullDay="true"]
[/calendar]

To add events to the calendar, use the Insert Date function from the composer options menu to insert a single date or date range in any reply to the topic. For example,

[date-range from=2018-12-20 to=2018-12-21 timezone="America/Boise"]

Any text above this line will describe the calendar entry. For example:

It's my birthday!
[date-range from=2018-12-20 to=2018-12-21 timezone="America/Boise"]

You can also create repeating events by using the Recurrence feature in the date-entry widget. For example:

I could never get the hang of Thursdays.
[date=2021-12-16 time=09:00:00 timezone="America/New_York" recurring="1.weeks"]

The tool won’t let you create recurring events with a duration, and it seems to ignore the actual date when you do this. But you can have something happen every Thursday.

Note that the calendar itself always is in UTC, so events that are a 24-hour single day in your timezone may appear to span multiple days. The plugin settings all day event start time and all day event end time can be used to reduce the impact of this if your users happen to be in a timezone where that works out to be convenient. (It is unclear what timezone these settings use.)

Once the reply is submitted, the date range should be added to the calendar in the top post in the topic, and displayed after a reload of the topic.

Once the event is over the post containing the dates can be automatically deleted, based on the delete expired event posts after plugin configuration option. You can also use the topic timer to auto-delete replies.

Holiday Calendar

There is an optional, special “holiday calendar”, primarily intended to help manage site staff holidays.

This is controlled by the setting holiday calendar topic id. By setting holiday_calendar_topic_id to the ID of a topic which has a calendar in the top post, that calendar becomes special — instead of regular calendar entries, any replies will be taken as “vacation time” for that user. These entries will be automatically (and randomly) colored. (It is not possible to control the colors, nor to get colored entries in the normal type of calendar.)

Additionally, the emoji :desert_island: will appear next to the names of people on vacation in their user cards, and a calendar icon next to their name when @username mentioned in a post.

Note that while any user with access to post in the topic can add an entry, these indicators are only visible to moderators and admins; this is not currently configurable.

The calendar will also by default include an entry for every user for every holiday in that user’s locale, if they’ve set one. This can be quite overwhelming. Adding

.calendar .grouped-event {
  display: none;
}

to a theme component and adding that to all themes will hide this as a temporary workaround.

Events

The plugin has an “Event” feature, but consider it in alpha state. This works entirely differently, and creates a site-wide calendar from entries across multiple topics, rather than per-topic calendars. For more information on this see 🗓 Discourse Event.

This should not be confused with the Events plugin (note plural), which is entirely different.

Screenshots

Dynamic Events Calendar

Holiday Calendar

Holiday Flair

holiday-flair

Holiday Mention Icon

mention

Translations:

https://translate.discourse.org/calendar

CHANGELOG

TODO

74 Likes

4 posts were split to a new topic: Category Calendar with defaultView=“listNextYear” not showing events

Hi!

I already achieved to plot the calendar and add an event on a topic, but… How can I add the calendar to the category bar?

like this example

Thanks!

Hi,
this particular example uses the Pavilion’s Events plugin Events Plugin 📆

To mimic its feature you might find this component useful Add category links Theme Component

2 Likes