Expired events with end times are being removed from upcoming-events even with setting set to -1

I am trying to utilise the Calendar Plugin, but it deletes the event from the calendar after it happens despite the fact that the settings are set to -1 to disable the deletion. I’ve also tried setting the expiry to two years (17532hrs) and that also removed the event straight after it happened.

The only way I’ve found to keep the events in the calendar is to remove the end time/date.

Does anyone know why the -1 doesn’t work, and what the solution is?

Thanks

2 Likes

Hello and welcome @Helen22 :slight_smile:

I’ve been reviewing this plugin recently and I handily have a couple of calendars on my test site to check against. Could I ask which flavour of calendar you’ve gone for where this isn’t working?

I have the calendar in the topic, and that one is keeping the expired calendar items:

I also have it as a category header:

And I also have an /upcoming-event one too for the event-style items:

I haven’t got an event-style one as a category header yet, so I have a feeling it may be that one… :slight_smile:


Actually, let me double-check the end times…

Yes, it appears adding an end time will make the event disappear from the /upcoming-event calendar, which does seem to be at odds with the other calendar behaviour. I think we should slide this over to the #bug category and see if we can get someone to look at it. :+1:

(and, just to be thorough, the non-event-style calendar is working as expected, even with end dates included)

2 Likes

If you’re referring to the setting delete expired event posts after, I think it prevents the deletion of the post, but not the display of the event, plus I think the term event here is misleading, it’s in the calendar section so I think it means more “date related thing” than “event in the rsvp-possible sense”.
that’s a calendar-event, not an event-event

event-events are meant to be displayed in /upcoming-events hence nothing in the past…

There is a PR about that actually: FEATURE: Show all events in past (add deleted_at in discourse_calendar_post_event_dates) + add show_past_event in settings by ledadu · Pull Request #199 · discourse/discourse-calendar · GitHub

3 Likes

I couldn’t decide if the quirk was that it did show past events as long as they didn’t have an end time, or that it didn’t show the ones with an end time. It perhaps may be something I could include in the plugin topic rewrite if it’s a case of expectation versus actual behaviour?

1 Like

:thinking: could an event be in the past if it doesn’t have an end time?

Car Chase Action GIF by Regal

I think the behavior now is expected, not showing past ones (ie with an end time in the past), but an option to be able to show all of them could be nice (but have unexpected UI side effect, I’m thinking here for instance: GitHub - paviliondev/layouts-event-list-widget: The Event List Widget allows you to display upcoming events in a sidebar using Pavilion's Custom Layouts Plugin.)
If you’re going for a rewrite of the topic, pleeease :sweat_smile: “event” should really be exclusively used to describe events related things, it’s very confusing when related to calendar

3 Likes

Yup. :+1: And possibly even a tweak to some of the setting descriptions as well. :crossed_fingers:

Rather than ping pong it to another category just now, I’ll leave it here and see if I can absorb some further clarity before finding it a forever home. :slight_smile:

But thank you for being so knowledgable about this plugin, it is a genuine help. :+1: :slight_smile:

2 Likes

Thanks all for your comments -

We have the upcoming-events calendar from the hamburger menu, and the upcoming-events in the category. Neither of them are retaining the events.

Where do I find this?

I agree with this, as visually the upcoming events calendar looks more utilised when it is populated vs when there’s nothing to show in it.

3 Likes

You can create a regular calendar by adding the following to the OP of a topic: (with calendar enabled checked)

[calendar]
[/calendar]

And then all of the following posts with a description and date will get added to it. eg:

It's my birthday!
[date-range from=2022-12-20 to=2020-12-21 timezone="America/Boise"]

You can then grab a category id of where you want to display it more prominently from the end of the category URL, and the post id of the calendar topic (you can get this from the json) and add it to this setting:

The calendar item posts in these topics are the ones controlled by the delete expired event posts after setting. :+1:

There’s more detailed info in the Discourse Calendar topic, though if you need extra help feel free to spin up a new #support topic too. :slightly_smiling_face:

Actually, this seems like a good juncture to slide this topic over to #support for its forever home now we know that the setting is working as expected. After I’ve updated the Calendar&Event literature it may be worthwhile creating new #ux or #feature topics to cover any missing ideas. :+1:

3 Likes

Thanks for your help @JammyDodger. I really appreciate it.

So just to circle back and clarify the answer my initial question, there is currently no way of keeping events in the upcoming-events calendar after they’ve happened, unless I remove the end time?

2 Likes

No worries. Glad to help. :slight_smile:

But yes, the only way to retain event-style items in the event-calendar/upcoming-events currently is to remove their end date. I wondered if another workaround to achieve something similar could be to create a ‘Past Events’ or ‘Event History’ calendar topic using calendar items? I’m not sure if that would be suitable for you, but may be worth an explore?

1 Like

Yes, that might work. I will look into it. Thanks!

2 Likes