Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Event calendar - RecentEvents() is showing future events for all and past events for one


Go to End


3 Posts   1613 Views

Avatar
nostradamus1935

Community Member, 9 Posts

14 May 2010 at 8:42am

I have come something strange in the event calendar extension. When using the RecentEvents() function in a template, it outputs all past and future events for one event... I don't think that's the intended behavior, but that's not the problem. The strange part is that any subsequent event is outputted just like the Events() function (that is, starting today onward). For example, one event will be displayed from the start date to the end date (repeating event, in this case) and all others like Events() (but not non-repeating events). Non-repeating events will show future dates in Events() but not past dates in RecentEvents().

If it helps, here is how my app is built : two classes, one to extend the calendar, one to extend the event. Two templates, one for each. Each includes another template which controls over RecentEvents (for the calendar) and OtherDates and Dates (for the event). In the event, everything works as expected.

I'm using r107. The problem was also in r106.

Has anyone seen this problem ? And how did you solve it ?

Thank you !

Avatar
UncleCheese

Forum Moderator, 4102 Posts

14 May 2010 at 9:43am

That bug should be fixed in r108.

Avatar
nostradamus1935

Community Member, 9 Posts

21 May 2010 at 1:54am

Yes, this bug has been corrected. Thanks !

However, I still encounter something strange. Now, I see past events for all non-recurring events (they all work as expected) but only for one recurring event, the others being ignored.

So let's say I have two recurring events, each recurring every day from Jan 1 to Dec 31. Today is May 20, so I see event 1 from Jan 1 to May 19, but I don't see event 2. What I do is that I populate a javascript event calendar with a <% control RecentEvents %> inside an extended class of Calendar. Maybe I'm not calling it properly...

I tried various cases to identify where's the problem and copied the function in my class so I could try a few things in it. I found out that after the first recurring event (event 1), dates for event 2 are being processed, but after the current date (so event 2 in the previous example would have dates from may 20 to dec 31). Eventually, it must get stripped out somewhere after... I've come to the conclusion that it must bet happening inside the addRecurringEvents (the thing with the dates being in the future), but have been unable to find the exact place.

Any idea ?