Support » Plugin: My Calendar » [Plugin: My Calendar] Upcoming Events – Display next month's events

Viewing 3 replies - 1 through 3 (of 3 total)
  • Wow, no love on this? I would think someone else would have the need to display future events without regard to the current date. For example, I have a client that wants to display all events for next month in a sidebar widget. Maybe the skip parameter could changes to be in line with the before and after parameters, regarding days vs events. So if the type is ‘days’, the skip parameter would denote days. This way, you could skip the number of days between the current date and your start date for the range desired.

    Regardless, i came up with a work around if anyone is interested.

    Plugin Author Joe Dolson


    Hey, Waretz – I’d be interested in seeing your work around. I’ve been sick for the last week, so haven’t really been able to keep up with these kinds of requests.

    Sorry to hear you aren’t feeling well. I love the plugin, by the way.

    Basically, what I needed was a widget that could display the events for an upcoming time period. For instance, next weekend or next month. What I did isn’t very elegant or efficient, but it works. Let’s use next month (April 2012) as an example. I first derive my start and end dates for the requested date range. In this case 04-01-2012 and 04-30-2012. Then I calculate the before(days) and after(days) parameters. Before(days) is 0 and after(days) is calculated by using the difference between the current date and my end date. However, I need to ignore any events between the current date and my original start date, so I make a call to my_calendar_upcoming using a daysafter parameter derived from the current date and the original start date. For this example, the days difference between 03-16-2012 and 04-01-2012 minus 1 day, because I want the events for my start day. I return the value from my_calendar_upcoming into a string and then count the number of<li> occurrences using substr_count to get the number of events I need to skip. I then use that as my skip parameter. The shortcode is built and passed back to the widget for display.

    I think a better fix would be to do what I mentioned in my post. Let the skip parameter be used for the number of events or number of days, depending on what the Type parameter is. What do you think?


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: My Calendar] Upcoming Events – Display next month's events’ is closed to new replies.