Events Plugin 📆

(Angus McLeod) #105

Fixed: BUGFIX: time setup · angusmcleod/discourse-events@f899310 · GitHub

(Chris Beach) #106

Thanks @angus, that fixed the problem I was seeing

(Andreas Dorfer) #107

Thanks a lot! (i should have looked at the documentation.)

(Angus McLeod) #108

@tobiaseigen @ChrisBeach I’ve fine-tuned the event display to:

  • handle all the edge cases for all-day event blocks;
  • add titles to the start of each row for multi-day / multi-row events
  • Allow multi-day titles to take multiple cells;
  • Clearly delineate the start and end of multi-day events when multi-day events are back to back.

Yeah, one is US/Pacific, one is Canada/Pacific and one is US/Pacific-New (apparently it’s different from US/Pacific). I tried to do a bit of formatting on the timezone labels as some can be a bit long (i.e. remove the country), but it’s hard to come up with good formatting rules as timezones don’t have really have any universal conventions. I’ve removed the formatting for now, so you’ll just see the full labels.


(Tobias Eigen) #109

awesome! looking good. the “select a timezone” issue is pretty minor.

I had a poke around in your sandbox and noticed a few oddities. See screenshot. one multiday event goes off the right side of the screen. The “x more” is showing on a day when there are only two events. One of those is pushed down on the day as well. I can see what you’re doing there but it looks weird - wonder how google calendar handles that use case?

I also added an event myself to the calendar and it’s not showing up.

(Angus McLeod) #110

Thanks again :slight_smile:

Arrangement of events

These are minor style calculation issues (fixed).

In most cases, the scenario you’re referring to here:

is necessary (the same is true in Google Calendar). This mostly happens because there are overlapping all-day events that end on different days. The plugin tries to ‘fill in’ when possible, but it can’t in a scenario like this.

If the hidden all-day event started on the 23rd, all of the events fit, e.g.

It’s a bit like a jigsaw puzzle.

There was one edge case which was handled differently in this plugin from Google Calendar, which is when there are overlapping all-day events that end on different days, causing a gap on a day in which there is also a normal event. In that case Google Calendar will ‘fill in’ the normal event.


I’ve updated the calendar sort logic to handle this case (see ‘Blacklight’ in above screenshots). I’ve also increased the height of day cells to handle 4 event rows and made some slight adjustments to the ‘x more’ style.

Routing and API

I’ve added proper routing to the calendar, so that only the topics with events for the date range displayed are loaded at one time.

This also means that there is now an API for retrieving an arbitrary range of events created with this plugin

  • will retrieve events in all categories within the specified range

  • will retrieve events in the specified category within the specified range

  • start and end dates are ISO86 format: YYYY-MM-DD

(Andreas Dorfer) #111

For “normal discourse categories” i can append an “.rss” to the url, in order to receive an RSS formatted feed.

with “/callendar.rss” or “/agenda.rss” this does not seem to work.
At least i just receive an empty reply. (not even a 404)

Is there different way to obtain that?

(David García-Navas) #112

This plugin is awesome!

Any chances to convert this plugin to official and enjoy it in Discourse hosted instances?

(Chris Beach) #113

I’d like to see this for the benefit of self-hosted instances too. The events plugin is really useful and universal. Making it an official plugin would reduce the risk of breaking changes between core and plugin. Obviously it’s up to the Discourse team as the more official plugins they support, the less agility they have to improve core.

(Chris Beach) #114

Minor bug: when clicking on a day in the calendar (mobile view), the calendar may switch to a different month (which is fine), but when this happens, the day selection highlight is lost.

Day highlight (blue circle) showing:

Tapped on the 1st March and now no day highlight showing (same with subsequent taps on days in March)

(Angus McLeod) #115

Thanks @ChrisBeach, I’ll fix this in the next day or so.

(Angus McLeod) #116

You’ll have to ask @sam.

I’ve added rss feeds to the site-wide /calendar and /agenda routes, e.g.

The calendar feed accepts start and end query parameters.

Add /calendar and /agenda rss feeds · angusmcleod/discourse-events@16fba94 · GitHub

Fixed: BUGFIX: selected date wasn't month-aware · angusmcleod/discourse-events@1c6c5bb · GitHub

(Andreas Dorfer) #117

Thanks a lot, it’s highly appreciated!

(Andreas Dorfer) #118

There seems to be an issue:

when adding "to google callendar"
the URL’s end-date is always “current date” (or posting date?), even if it is “without end date”.
(despite that current date is wrong value.)

eg. from this event
you get “ät,+14,+Schadowplatz,+Stadtmitte,+Stadtbezirk+1,+Düsseldorf,+Regierungsbezirk+Düsseldorf,+Nordrhein-Westfalen,+40212,+Deutschland&sf=true&output=xml

BTW: 2nd small issue: handling of diacritical characters (here: “Umlauts” like “ü” are not passed to the URL.

(tran) #119

I can choose the end date, but the end date will not be displayed in my topic, only the start date. When you add to the Google Calendar, the title can only recognize English numbers and symbols, but my website is not English - based,so the title is empty.

(Angus McLeod) #120

@adorfer Thanks, I’ll have a look at these issues tomorrow.

@tran Thanks. I’ll have a look at the Google Calendar issue tomorrow. For the end date issue, could you give me some more details and / or an example? I just tested the functionality on my sandbox and it’s working fine, see e.g. Late Night Jamming - Events - Angus’ Sandbox

(tran) #121

@angus THX for replying. Amazing,the end day is normally now.

My language is Chinese,title cannot be displayed in Chinese

(Chris Beach) #122

Bug report: I edited a post to add a date, and set it to be “all day”

The date was then displayed on the post with a time of “00:00” and when editing the post again, I noticed the “all day” checkbox was unticked.

(Angus McLeod) #123

@ChrisBeach The all day bug should be fixed now. Let me know how you go.

@adorfer @tran There were a few issues with adding to Google Calendar, some on my side, some weirdness with Google Calendar. Everything should work now.

Also, special characters should work in titles of events imported to Google Calendar now.

(tran) #124

@angus The special characters problem still exists.