Events Plugin 📆


Would be nice if its possible to configure start day of week. Its realy common for germany to start the calendar at monday on left side. Some of our users are confused that its sunnday at displayed calendar.

Another feature that would be nice is adding multiple dates to a topic. Sometimes we got events that are on multiple dates and creating a new topic for each event is mostly copy & paste, expect the date.

(Tom Newsom) #146

Does this button only show up for Public calendars (ie. in categories with the default security settings)?

I’m not seeing it on my discourse, but it’s in an admins-only testing category…


that’s why you don’t see the button:

(Tobias Eigen) #148

Fabulous, Angus! I look forward to testing. I see another bug.

If you open up the day view via the “+ nn more” and forget to close it, then switch to a different month, the day stays open.

** edit ** added screenshots.


(Stan Dyck) #149

I’m seeing a problem with end dates for events being off by one.

When I create an event for March 8, 4:30-6:30

The Add to Calendar ics file looks like this:


where the DTEND shows up as March 9. The Google export also has March 9.

I love this plugin and am glad to see it making progress!

(Angus McLeod) #150

The calendar is configured so that the start day of the week is set by the moment_locale settings (full list here). For the German locale de, the start of the week is in fact Monday. You can test this by changing your locale to de on my sandbox.


Are your German users not using the German locale?

Yes, this has been raised before. This may be on the agenda in the future, but not for a little while.

@Tom_Newsom Yes as @craisp notes, subscribe links won’t work in categories with restricted view permissions. To support this the iCal link would need to include authentication. It’s on the agenda, but not a priority.

Thanks again, great bug spotting :bug: . Will fix later today.

This is the subject of this PR

I will address this issue and the associated issues discussed in the PR later today or tomorrow.

(Tom Newsom) #151

No problem. I don’t actually intend to have any private calendars. It just means that testing has to be in public :slight_smile:

(Angus McLeod) #152

This is fixed: expandedDate should reset when month changes · angusmcleod/discourse-events@f9c4fb0 · GitHub

The reason a day was being added was that, for some reason, Google Calendar (and other major clients) remove a day from a date range for all day events you import. e.g.

I thought I was doing something wrong with timezones, but apparently not, see:

So I’ve restricted the +1 day to all day events. It should work as expected now.

(Tobias Eigen) #153

looking really good, angus!

one minor issue: did you notice on your sandbox that when you click around in the calendar months, it jumps right a few pixels as you click. Then it jumps back again. A bit disconcerting.

(Angus McLeod) #154

Yes, I’ve been meaning to fix that. It’s due to the custom layouts plugin, not this one. In any event, I’ve addressed it now.

(Chris Beach) #155

Hi Angus - just an observation - some of our users have added date/times to topics that don’t warrant them.

I sent a PM to one of them today and mentioned that date/times weren’t really intended for general discussion topics. He replied that he was “prompted” to add a date/time

I wonder if the “Add Date and Time” button on the desktop UI is too prominent? Perhaps it could be made more subtle as per the mobile UI, where it is a small icon button next to one of the input fields.

If so, this modified desktop layout would also benefit the composer by taking up less vertical space.

(Angus McLeod) #156

Interesting. @tobiaseigen has been saying the same thing (suggesting it belongs in the composer menu). The case for reducing the prominence of that button is looking pretty strong.

I’ll take a closer look at it in the next few days. Any suggestions in addition to the composer menu and the mobile UI are welcome.

**edit @ChrisBeach I’m curious to know a bit more about the context here. Is the category in which events are enabled also used for general discussion?

(Chris Beach) #157

Yes. I found the use case for date/times extended beyond our “Events” category.

For example: We have a “local services” category designed for discussing local utilities/transport etc. When there were widespread water outages in London it was useful to have a date range on topics like “water outage”

But not all topics in “local services” are discussing events on specific dates.

(Tobias Eigen) #158

Thanks, Chris, for also sharing your community feedback. It’s good to hear I’m not alone. :slight_smile:

I’ve actually been contemplating rejiggering the category setup in my community to streamline the categories and have fewer of them. This is veering a bit off topic but I’d be interested in understanding how Angus thinks we should be using categories including the events category. It seems to me that some communities use more functional category distinctions, e.g. for events, discussion, off topic, feedback, howto (wiki) etc or to separate languages, or to provide subsets of private categories. Tags can be used more consistently to make related topics more discoverable. In my community to date we’ve had thematic categories and thrown all the different kinds of topic into them, excepting private categories and other languages.

There has been some push back to my proposals to do this - I think people like to find and connect with their sub-tribes within the community, based on the issues they are working on. I also am turned on by the idea of having events separated into themes which then look pretty in the calendar and can be filtered.

But on the other hand, coming back to this feedback from Chris, I agree that the event dates button is too prominent for civilian use as the vast majority of topics will not want event dates and people will just be confused by it. So unless and until it is moved somewhere more subtle, like the post options menu, my inclination is to install the events plugin and limit to moderators/high trust levels the privilege to add topics to the calendar. I will then directly train the people who have this privilege, starting with moderators. They (and mostly I) can then add the events to the topics that warrant them.

And another thought: there has been discussion about more posts in topics being allowed to be given event dates. If this were to happen, then it even makes sense to have the button in the post options and it can appear for all posts even replies (but again, only to people who have the privilege and tucked away).

(Tom Newsom) #159

Would a button text change be enough?


(Tobias Eigen) #160

Or a less prominent link that is not a fully fledged button, just a small font question linking to the form? E.g.

This topic is about a calendar event

(Angus McLeod) #161

Thanks for all the feedback.

I’ve made two small changes:

  1. There’s now site-wide and category-specific settings to remove the label from the add event button: events_event_label_no_text. I added the category specific settings as its conceivable you’ll want a label in a dedicated events category and no label in other categories.

  2. I’ve taken advantage of the flexboxisation of the composer by @awesomerobot to allow the event button to sit inline with the title and category controls when events_event_label_no_text is on.


These changes can be used in conjunction with:

  1. The existing plugin settings to format the event label when a user has added an event (using moment.js formatting)

  2. The existing plugin setting to change the event label icon.

  3. Admin > Customise > Text Content. This can be used to change the text on the label itself (as per @Tom_Newsom’s suggestion). The key you want is: add_event.btn_label.

  4. The Min trust to create event in this category setting, which allows you to restrict (and hide the controls for) event creation according to trust level on a per-category basis.

I think there is no right answer here. My goal with this plugin is to allow it to accomodate as many (proven) use cases as possible.

I originally imagined that it would be used in a dedicated events category, but I think it’s pretty clear now that there’s also a mixed category use case.

Likewise with the trust level permissions. I didn’t originally think about that when building this, but since you’ve raised it and the more I’ve thought about it, the more obvious it seems. The ability to create events can be a powerful one.

Yes, this is the idea behind the site-level calendar vs the category-level calendars. You can’t currently ‘filter’ the site level calendar itself. I’m just wondering about the marginal utility of having a category-filter on the site-level calendar, given there are already category-level calendars. Perhaps there is a case for it. Not sure.

There are two things holding me back on this:

  1. There’s an unreleased plugin which seems to do something very similar: Discourse-chronos 🌐 ⏲

  2. This would be an entirely new feature ‘vector’. Even if I were to add it here, I would prefer to make sure the topic <> event vector is substantially finished first.

(Sora &\) #162

Hello, How can i setup add event to all category, all topic?
I wanna add event when user comment, Display add event in Comment?
Thank you!
Can we setup quickly for all category user this plugin?

(Tobias Eigen) #163

Thanks, Angus! This is all very impressive. I understand the direction and support it. Looks like we’re about ready to install this in my community. :rocket:

(Tom Newsom) #164

Great support and responsiveness as always angus :slight_smile:

Thought: Repeating events?