Date range seems wrong

Hi, I’m on Discourse 2025.11.0 and I think there’s an issue with the calendar pagination:

I created two events:

  • from 2025-08-27T14:00:00.000+02:00 to 2025-08-27T15:00:00.000+02:00
  • from 2025-11-29T12:00:00.000+01:00 to 2025-11-29T13:00:00.000+01:00

When, in the calendar, I display the current month (/upcoming-events/month/2025/11/1), I can see that the API call is made with the right before/after dates:
/discourse-post-event/events?after=2025-10-27T00%3A00%3A00%2B01%3A00&before=2025-12-08T00%3A00%3A00%2B01%3A00&attending_user=.

But the two events are returned, even if the first is out of range.

And when i change of month to display 08/2025, no event are returned.

2 likes

Just tried locally and I can’t reproduce :thinking:

Any chances you could detail your steps?

1 like

Hi @zogstrip !

I’m redoing it after clearing all my dev environment (data and tmp), and could not reproduce it either. That’s weird. It may come from invalid data I had earlier.

Sorry for the issue.

But yes, for the steps, I “only” created two events with different dates, via the “new topic” form.

No worries at all.

I’ll close this one then.

Feel free to ping me if you figure out reproduction steps :+1:

Well, I got the steps !

  1. Create an event for today (I don’t think the date is relevant)
  2. Edit the post and change the date to the previous month (in the post editor, not the event form, nor the “Edit this event” button from the event itself)
  3. Do it again (event should be in october now)
  4. Move to october : no event in the API response
  5. Move back to december: the event is here (but not displayed as the date don’t match)

Edit: I changed the dates via the “Edit event” button from the event details, to september, and now it is returned on the API call for november

I’m afraid I’m still not able to reproduce. Whenever I edit the post to change the month in the markdown, the event shows up correctly in the “upcoming events” calendar.

I don’t know if that helps, but I recorded the steps.

I cannot attach the video to the post; the link is valid until 2026/02/01

1 like

I’ll see tomorrow if I can reproduce this in a RSpec test

Thanks for the video, I was finally able to reproduce locally :raising_hands:

It was quite subtle, but here’s the fix.

3 likes

Well done!

Thank you for looking at it!

1 like