Events Plugin 📆


(Yaw Anokwa) #64

I’m loving the changes you’ve been making to the plugin, @angus. Thank you! In your latest build, you allow for Agenda in the top menu which is great, but in categories that allow events, we get duplicate links. I’d be good if there was only one that was specific to that category.

When you select latest

When you select event


(Angus McLeod) #65

Thanks for the quick report. Fixed:


(Tobias Eigen) #66

Hi Angus! I just did a test of your events plugin on your sandbox, and like the interface! Following up on @ron_jeremy’s suggestions above… some feedback below. Sorry if all of this has been suggested before. :slight_smile: I read through this entire topic and see I repeated alot of requests - oops. added links where relevant, hope it helps.

  • it would help if, as soon as the start time/date has been set, the end time/date would be set to be the same. it could then be left as is (to have no end time/date) or updated by the user to set the end time/date
  • I am missing an “all day” tickbox when adding events that are all day events like @allanlasser
  • I am missing time zone information here when entering events and viewing the events in the agenda.
  • I am missing a calendar view directly in discourse. I realize it’s probably too much work to be worth it but it would be nice to see a similar interface as google calendar e.g. weekly, monthly, annual calendar view. (like @meglio mentioned above and @supernaturally mentioned too - with screenshots)
  • on the agenda view, I am missing the ability to toggle the chronological sort order of events (newest first, last first)
  • in my community, many topics across the community are about events with dates… but I think it might be a bit overkill to allow every member to add them to their topics. it might also be distracting. so maybe allow events across all categories but limit the ability to add event dates to staff or by trust level? we could then add the dates later. or put it a toggle in the composer options when editing the OP for a topic, to bury the feature so it is less distracting/confusing? (your location plugin options could also be buried in this way, perhaps) Edit: ah, I see this is being discussed over there. here’s my reply.
  • it would be sweet to provide a calendar subscription feed url that can be added to e.g. google calendar - like screenshot below. Perhaps this could have url methods for adding all events to your google calendar or only events in specific categories. e.g. SITEURL/events.ics (all topics with events dates) or SITEURL/events/soccer.ics (just topics with events dates in the soccer category) etc. A link to subscribe would be on the agenda view. like @Tom_Newsom mentioned above.
  • some sort of notification or nudge to people when a scheduled event is coming up would be interesting. e.g. if I like or reply to the event topic then it is assumed I am interested - maybe I could have a user preference setting to indicate if, when and how I’d like to be reminded of the event (by email, by notificaition, by some sort of banner or popup)


(Angus McLeod) #67

Thanks for all the feedback everyone. I’ll tackle it in pieces.

I’ve started by adding all day events and optional end date/times.

The UI should be self explanatory.

Examples:

  1. All day event over multiple days:

    Modal:

    Label: 49%20PM

  2. Single event time without end:

    Modal:

    Label: 20%20PM

Some notes:

  • Behind the scenes, “All day” means 00:00 to 23:59 on the relevant day(s). You won’t see these times in the UI if the event is all day, but those are the times being saved to the db. This is easier to work with if we want to use the events in other formats such as calendars and ics feeds.

  • The sql query that removes past events from the agenda when the events remove past events from agenda setting has been changed slightly. It now:

    1. First checks if the event has an end and if the end is passed;

    2. then checks if the start has passed.

    This is necessary because not all events will have end times now. This means that if you have not set an end time for your event, and you have the events remove past events from agenda setting on, the event will not appear in the agenda as soon as the start time passes.

You can test it out (and see some examples I just made) here: Events - Angus' Sandbox

cc @allanlasser @ron_jeremy @tobiaseigen


(Tobias Eigen) #68

fabulous - I tested these changes on your sandbox and they work great. :rocket:

I noticed google doesn’t bother with the “include event end” option as you do in order to turn on the ability to add an end date/time. It just defaults to being the same date for the start and end. It makes this less confusing by not showing the date or time picker unless you click on one of them.


(Angus McLeod) #69

There is a substantive difference here insofar as you can actually have an event datetime with no end at all (which you can’t in Google).

This was requested, and I think it makes some sense for certain types of events. It also allows the events plugin to potentially handle other types of ‘times’ (i.e. other than actual events, which have a duration, even if the duration is indeterminate).

I understand why Google has taken this approach, but technically (i.e. grammatically) this doesn’t make sense:

There is no time gap, so it’s not really “8am to 8am”. It’s just an event at 8am.

Also (while I’m being really picky :slight_smile: ) the entry on the calendar UI is incorrect insofar as it suggests the event takes 1/3 of an hour, when I’ve recorded it just as “8am”:

09%20AM

Of course Google calendar is generally pretty great, so I’m not about to die fighting on this hill, but I do think having the ability to not have an end at all is worthwhile.


(Chris Beach) #71

I set this up on my forum and am delighted with how well it works, and how customisable it is (in terms of settings and also via CSS).

I think it’s worthy of becoming a core plugin if the Discourse team were willing to consider this.

One little extra that would be useful to me - featuring the date in the metadata (ether the title, or at the beginning of the description) when a Discourse post is shared on social media.

Also, another very minor point: I used some JS to insert a “Calendar” link into the nav menu. This takes the user to the Agenda page of my Events category. However, a result of this is that on that page, the user sees both “Calendar” and “Agenda” in the nav menu. Can anyone suggest a workaround?


(Angus McLeod) #72

You can edit the plugin translations in Admin > Customize > Text Content. The one you want is filters.agenda.title. You won’t need the extra link.


(Chris Beach) #73

Thanks for the tip, @angus.

The reason for adding the extra link programmatically is that I want users to see a link to the agenda of the events category on the homepage.

Prior to my JavaScript, they could only see the agenda link if they browse to the events category page.

Hope that explanation makes sense - I know my requirement may be niche.


(Angus McLeod) #74

Ah :slight_smile:

This plugin also has a ‘site level’ agenda too. If you add ‘agenda’ as an item in the top menu site setting, the button will appear on top level discovery lists. The top level agenda shows all events on your instance (e.g. if you have two events categories it will have events from both).

Screenshot%20at%20Feb%2003%2022-18-46


(Chris Beach) #75

Excellent :+1:

Combined with the text customisation this meets my needs perfectly. Thanks @Angus!


(Angus McLeod) #76

Times are stored in UTC then converted to the user’s timezone via momentjs, so the user always sees the right time for them. See e.g:

I will add in their user’s own timezone in the timestamp as a site setting to make sure the user knows this.

Yes, perhaps it’s almost time to do this. I’ll think about it this coming week.

This is something I’m both not averse to doing and also think makes sense from a product perspective :slight_smile: I see this as somewhat different from the location of the toggle in the UI. I can also take a look at this this coming week.

Yes, iCal feeds…I have avoided them so far because the last time I oversaw adding them into an app it resulted in multiple user complaints, mainly because Google Calendar has a hard-coded 24-hour iCal feed sync cycle :sweat_smile:

Maybe.

Yes this is a good idea. I’ll have more of a think on this the coming week.


(Angus McLeod) #77

I’ve added a setting to show the UTC offset of the datetime shown in the event label.

events event label include timezone

The timezone will always be the user’s own timezone, as the event datetime is always shown in the user’s own timezone.

I have used UTC offsets, e.g. +08:00 or -05:00, because there is no universally consistent way to obtain timezone abbreviations like ‘PST’, even with momentjs-timezone, without ‘guessing’. See further here.

This will mainly be useful for communities that have users in different timezones.

Example:


(Angus McLeod) #78

I’ve added a calendar topic list for this plugin.

  • It’s built from scratch to be fully compatible with Discourse (no third party calendar libraries).

  • It’s responsive.

  • It supports both time-specific and all day event topics.

  • It’s localised.

    • Site and user localisation is respected.

    • All text is already translated (thanks to the moment.js localisations in Discourse core), apart from the ‘Calendar’ label itself.

    • The start of the week is set according to the moment.js localisation setting (see further here).

  • The agenda and calendar topic lists can be turned off and on for each category in the category settings and for non-category lists through the top menu setting.

  • The agenda and calendar topic lists can be be set as the default list for a category.

Examples on my sandbox.

cc @tobiaseigen


(Tobias Eigen) #79

Sweet! Looks really great - nice job. You are a wizard! :sparkler:

Looking at the calendar view, I am missing google calendar features:

  • links to TODAY, previous month/next month (see screenshot). It’s nice to be able to orient yourself.
  • today’s date is highlighted
  • dates in the past are greyed out
  • popup summary view of event when selecting an event. being taken away to the event topic is a bit jarring, esp as it’s hard to find your way back (see below)

46%20PM

I really like the way on mobile, you see info about the event you’ve selected - though “multi-day timed start” is a bit awkward language.

I also noticed that when you are looking at an event topic on your sandbox, you no longer see the nav menu so it’s clunky to get back to the calendar.

… and, of course, now that there’s a CALENDAR menu item, the ADD TO CALENDAR button is potentially confusing. Now maybe it should read ADD TO MY CALENDAR or some such, to distinguish between your own calendar and the discourse site calendar.

Does the event topic in the calendar take the color of the category it’s in? It seems to be that way and if true that’s awesome! :rocket: Maybe category color could be accentuated for single day events too?


(Angus McLeod) #80

Great feedback! I’ll reply in more detail later, just a couple of quick clarifications.

Today’s date’s is highlighted (background is grey). Do you mean something else?

** edit: maybe the wrong day is highlighted for you? If so I need to fix the localisation of ‘today’.

Screenshot%20at%20Feb%2012%2016-06-26

Indeed, but that’s just a topic title. It’s not part of the plugin :slight_smile:

No, but it’s a good idea.


(Tobias Eigen) #81

Thanks, Angus! All good stuff.

Ah - I can see now that today’s date is indeed highlighted. The contrast on my screen tricked me.


(Andreas Dorfer) #82

How can i make that appear?
I can not find it anywhere, possibly i am missing something.

Perhaps it does not well work with the “header search” plugin. Or it lacks something in the german language file?

BTW: Is there a dedicated URL for the RSS/Atom-feed of all upcoming events, in order to include this in other websites/calenders.

example:


(Tobias Eigen) #83

Try from within the category that has event topics enabled.

I asked for RSS feeds above too. A good feature request methinks and glad you also are interested.


(Andreas Dorfer) #84

Same thing. as shown in the picture above.