Discourse 日历(与事件)

:discourse2: Summary Discourse Calendar and Event adds dynamic and interactive calendar and event features to your Discourse site.
:open_book: Install Guide This plugin is bundled with Discourse core. There is no need to install the plugin separately.

Enabling Calendar (and Event)

The Calendar plugin can be enabled either by the toggle or from its settings, both accessible from your admin/plugins page:

/admin/plugins

Features

Somewhat unsurprisingly, Discourse Calendar (and Event) adds both the calendar and event features to your Discourse site. With these, you can create individual topic calendars to track important occasions or timelines, display calendars in categories, add a holiday calendar to mark vacations, absences, or sick days, create interactive event topics, as well as show an easy-access calendar summary of all of your upcoming events.

Calendars

Bespoke calendars can be created in multiple topics, and ones you wish to give higher visibility to can be displayed above a category’s topic list.

You can find more detailed information on how to create and use calendars in:

Events

The Event feature allows interactive elements to be inserted into topics which your members can use to sign up to attend or participate in your community’s activities. These are all summarised in a dedicated site-wide calendar, with the option to add an easy-access link to your navigation menu. You can find more information on how to create and use this feature in:

:exclamation: This should not be confused with Pavilion’s Events plugin (note the plural)

Calendar Settings

Name Description
calendar enabled Enable the discourse-calendar plugin. This will add support for a [calendar][/calendar] tag in the first post of a topic.
holiday calendar topic id Topic ID of staffs holiday / absence calendar.
holiday status emoji Defines the emoji used for the holiday status.
delete expired event posts after Posts with expired events will be automatically deleted after (n) hours. Set to -1 to disable deletion.
all day event start time Events that do not have a start time specified will start at this time. Format is HH:mm. For 6:00 am, enter 06:00
all day event end time Events that do not have a end time specified will end at this time. Format is HH:mm. For 6:00 pm, enter 18:00
calendar categories Display a calendar at the top of a category. Mandatory settings are categoryId and postId. eg: categoryId=6;postId=453[1] Other valid settings: tzPicker[2], weekends[3] and defaultView[4].
calendar categories outlet Allows to change which outlet should show the category calendar.
working days Set working days. You can display the availability of a group using the timezones tag in a post, eg: [timezones group=admins][timezones]
working day start hour Start time of the working day hours.
working day end hour End time of the working day hours.
close to working day hours extension Set extension time in working day hours to highlight the timezones.
calendar automatic holidays enabled Automatically set holiday status based on a users region (note: you can disable specific automatic holidays in plugin settings)
map events title Maps title of the sidebar calendar based on category. Defaults to “Upcoming events”

Event Settings

Name Description
discourse post event enabled Enables the Event features. Note: also needs calendar enabled to be enabled.
discourse post event allowed on groups Groups that are allowed to create events.
displayed invitees limit Limits the numbers of invitees displayed on an event.
display post event date on topic title Displays the date of the event after the topic title.
use local event date Use local date after topic title instead of relative time.
discourse post event edit notifications time extension Extends (in minutes) the period after the end of an event when going invitees are still being notified from edit in the original post.
discourse post event allowed custom fields Allows to let each event to set the value of custom fields.
events calendar categories Display an events calendar at the top of a category.
sort categories by event start date enabled Enable the sorting of category topics by event start date.
disable resorting on categories enabled Allow categories to disable the ability for users to sort on the event category.
sidebar show upcoming events Show upcoming events link in the sidebar under ‘More’. Requires post event enabled
map events to color Assigns an event color to a specified tag or category

:information_source: :curling_stone: The discourse-post-event/events.json endpoint now has an added parameter to switch between simple and detailed response. To get the detailed response you can add ?include_details=true:

/discourse-post-event/events.json?include_details=true

Integrations with Other Plugins

You can use a component from this plugin with Right Sidebar Blocks. You’ll want to ensure the desired route is enabled in the Right Sidebar Blocks component. The block name will be upcoming-events-list. Historically, there were additional settings required in the Calendar plugin itself, but this has been streamlined.

This is how the sidebar calendar will appear by default.

If you don’t want the time, you can add an empty timeFormat value in the component’s block setting.

:discourse2: Hosted by us? This plugin is available on our Business and Enterprise tiers Calendar | Discourse - Civilized Discussion


  1. categoryId is the category the calendar will be displayed on top of.
    postId is the post in which you put the calendar in with [calendar][/calendar] ↩︎

  2. it can display a time zone picker on the upper right of the calendar. False by default, you can enable it with tzPicker=true ↩︎

  3. it can hide Saturdays and Sundays from the calendar. True by default. You can set it to false with weekends=false. ↩︎

  4. defaultView will set the calendar’s view (day, week, etc;). It can be set as:

    defaultView=agendaDay
    defaultView=agendaWeek
    defaultView=month (default)
    defaultView=listNextYear ↩︎

Last edited by @tobiaseigen 2025-07-16T21:10:06Z

Check documentPerform check on document:
97 个赞

这个插件很有前景,但缺少一些功能,这使我们无法从 Pavilion 的插件迁移过来

  • 在日历上显示带有开始时间的非全天事件,目前所有事件看起来都像全天事件。

  • 在撰写器中,标签选择器旁边有一个“添加事件”按钮(而不是隐藏在齿轮图标中)

  • 限制哪些类别可以有事件,以及事件在类别中是否是强制性的

锦上添花的功能:

  • 主题中的事件元数据仅出现在主题顶部(而不是光标所在的位置)
  • 能够限制哪些组可以在类别中创建事件(例如,只有“EventPlanners”组可以在“Discussion”类别中创建事件,但所有用户都可以创建非事件主题(或在主题设置为 Wiki 时编辑主题)
  • 将 /upcoming-events 的 URL 更改为 /calendar
13 个赞

2 篇帖子已拆分到新主题:Holiday status being incorrectly applied

你好,
感谢你的工作。

我有 2 个用户体验问题:

  • 是否可以在主题编辑器中将“添加事件”按钮显示在“添加位置”按钮旁边?就像 pavillion 插件那样?
    image

  • 是否有可能在顶部菜单中添加“日历”条目?我在设置中找不到它

这看起来很棒!一些想法/问题:

我是否可以假设,要创建一个日历,只需创建一个新帖子/主题,然后将以下内容粘贴进去:

日历名称

[calendar]
[/calendar]

然后,要向日历添加条目,只需在同一帖子中发布类似以下内容(通过点击帖子选项中的“插入日期/时间”图标):

事件/条目名称

[date-range from=2024-04-18 to=2024-04-19 timezone="Europe/London"]

这会将条目添加到日历中,这很棒,但是:

  • 是否有任何方法可以将条目添加到日历中,但让这些条目也有一个专用的帖子/主题?(我看到您可以在新帖子中添加事件,但似乎没有办法将这些事件添加到日历中)。
  • 是否有任何方法可以在摘要电子邮件中展示特定日历的“即将发生的事件”?或者也许是左侧栏,并且每个条目都链接到该条目的专用帖子?

如果目前不可能,您是否有计划添加这些功能?

1 个赞

@vinothkannans 你能帮我审查一下这个pr吗?

1 个赞

是否有计划添加用户可以订阅的 URL Feed?我敢肯定,对于所有活动与他们已回复的活动相比,这会很棘手。

其次,如果能识别私人活动(或者也许每个群组都有不同的 URL Feed),那么增加一个额外的层将是惊人的。

6 个赞

但是,/upcoming-events URL 没有rss feed——那将是一个很好的补充!

3 个赞

关于 CalDAV 同步怎么样?

6 个赞

那对我来说也是一个更换的理由,确实如此。

这需要更多更新,因为它提到了在作曲家(composer)中插入事件以及添加事件详情,与图中所示不符。除非事件是附加项?

我已经安装了插件,日历标签在主题的第一篇帖子中有效。但在齿轮菜单中看不到任何事件或日历选项:

有人能解释一下我需要做什么才能在齿轮菜单中获得事件选项吗?

您需要启用插件 discourse post event enabled 的事件部分。

2 个赞

谢谢。我不知道怎么错过了这个设置。

3 个赞

如何让“创建事件”在类别主题中显示,并且回复是事件?

我看到“创建事件”可以用于创建新主题。但我想在主题中有一个日历,并且回复可以添加事件。使用“插入日期”功能可以部分实现,但不如“创建事件”功能那样有更多选项。

1 个赞

目前用户可以在其个人资料偏好设置中选择地区。

我想让他们在注册时设置地区,在注册表单中显示此字段。这是否可行?

2 个赞

删除的回复是否仍会显示在日历上?

我找不到将每周第一天更改为星期一的任何设置,如果缺少此功能,是否很容易实现?:thinking:

另一个问题是时间和日期输入已损坏,如果这是一个全天事件,则应在时间输入字段弄乱日期之前提供选择它的选项,并且在编辑时日期似乎会随机更改。

我还注意到,可以在时间和日期中输入 00:00(有时有效,有时无效),这会导致日历出错,然后会导致与草稿发生冲突,从而导致重复的 422 错误,直到页面回滚到早期修订版,然后重新编辑等。

3 个赞

[quote=“slower, post:10, topic:277113, full:true, username:joo”]
激活此自动化时,“最后编辑者”内容会自动添加到日历。我想咨询一下这是个错误还是我的设置有问题。有人能帮忙澄清一下吗?


[/quote]请参考这里

1 个赞

没有这样的设置,所以我才不使用它。我敢打赌,如果这是一个微不足道的技巧,团队会修复那个错误。

1 个赞