Jump to:

10851 Posts in 2517 Topics by 1793 members

All other Modules

SilverStripe Forums » All other Modules » Event calendar - RecentEvents() is showing future events for all and past events for one

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 890 Views
  • nostradamus1935
    Avatar
    Community Member
    9 Posts

    Event calendar - RecentEvents() is showing future events for all and past events for one Link to this post

    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 !

  • UncleCheese
    Avatar
    4085 Posts
  • nostradamus1935
    Avatar
    Community Member
    9 Posts

    Re: Event calendar - RecentEvents() is showing future events for all and past events for one Link to this post

    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 ?

    890 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.