Event list widget continues to display past events

Environment

Discourse Version: 2.9.0.beta11

Plugin Commit: Layout Event List Widget: 1.0.0

Steps to Reproduce

I installed the Event List Widget, set it up on the sidebar using the Layouts plugin, and have been adding events using the Calendar plugin just like in the instructions. Everything seems to work fine except that past events remain visible in the widget. The widget is configured to only show 3 events. Right now, the three being shown include two in the past. An event I just added for two weeks into the future doesn’t appear because these past events are taking up the space. I know I can archive the old posts, but it seems like that shouldn’t be necessary considering the default title of the widget is “Upcoming Events”.

I hope this is an easy fix. And thank you for a great widget!

Example

It’s a private community. I cannot provide a link publicly, but you could contact me privately and we can arrange to give you temporary access.

Logs

Screenshot showing past events. Today’s date is Nov 2, 2022.
https://drive.google.com/file/d/1qASwgSdvthyQ7Vg9x4mSLwQyLSLtHsrB/view?usp=share_link

@ashley The widget actually uses an endpoint in the Discourse Event plugin that is meant to only return dates in the future.

After a fair bit of testing I managed to recreate the issue though. It only arises (in some instances) if your events in the Discourse Event plugin don’t have end date/times. Technically this is an issue with that plugin, however as that wouldn’t solve your issue I’ve added an additional date-based filter to the widget to ensure there’s only future events display.

https://github.com/paviliondev/layouts-event-list-widget/commit/b03540d3930cc1bbca1ebc97d9d781bcb511b7c8

Please update to the latest version.

Aha. You are absolutely correct - I was not including an end date. Sorry for not even thinking of that detail. Many thanks for finding a solution!

This topic was automatically closed after 2 days. New replies are no longer allowed.