WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Events not in order on calendar (14 posts)

  1. Bri-
    Member
    Posted 2 years ago #

    In the calendar, events are not always listed in order of start date as I would expect them to be. This is also the case if I rollover a day on the mini-calendar (they don't appear in order of start date).

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    Hi,

    do you have a sample link which can us analyze?

  3. agelonwl
    Member
    Posted 2 years ago #

    sorry, a sample link that can help us analyze the problem.

  4. olyma
    Member
    Posted 2 years ago #

    I think I'm having the same problem right now, too, but I'm using an older version (3.0.95). Searching the forums, this bug appears to have also been reported a long while back in:

    http://wordpress.org/support/topic/plugin-events-manager-calendar-items-not-arranged-chronologically

    but may be have been not fully resolved in more recent versions of this plugin, as you, Bri-, are reporting now. Specifically, for me though, the bug is that on the "Calendar" page, the events in each day-box are listed in the order that they were entered, and not in the order that they are actually going to occur. I've been digging through the code all night tonight to find a solution and here's what worked for me:

    In the "classes" directory, find the file "em-calendar.php" and right after $long_events = $args['long_events']; (approximately at line 16 in 3.0.95, line 20 in 5.0.42) insert the following code and save the file:

    $args = array(
    'orderby' => 'start_date,start_time,name',
    'order' => 'ASC',
    );

    At least this worked for me.

    Wellest wishes!

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    I've noted down to add an ordering option in calendar settings, maybe it'll make it into 5.0.5

    @olyma You have a fair bit of upgrading to do :) remember if you do to first go to the latest v4, THEN v5.

  6. olyma
    Member
    Posted 2 years ago #

    Actually, the code above is having some ill repercussions elsewhere in the calendar, I'll check back later as I continue get it ironed out.

    Later....

    Okay the code above should instead be:

    $full = $args = array(
    'orderby' => 'start_date,start_time,name',
    'order' => 'ASC',
    );

    And that works on all "Calendar" pages now. :D

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    This has been done now in v5 and you can choose that in the calendar format settings

  8. Bri-
    Member
    Posted 2 years ago #

    Sorry, I've been gone for a while. I have Version 5.0.42 of the plug-in, and it still appears to have the problem. Here is a sample calendar that shows the problem:

    http://pike-ef.org/calendar/

    One example is on Feb 18th (the 6:30 event appears before the 5:30 event), but there are many other examples on that calendar. Rolling over the dates in the mini-calendar also has the same problem.

    Marcus, should it be fixed in 5.0.42? I still have the problem and don't see the option in the calendar format settings.

    olyma, thanks! I'll try it tomorrow!

    -Bri

  9. agelonwl
    Member
    Posted 2 years ago #

    calendar ordering option will be added to the next release.

  10. Bri-
    Member
    Posted 2 years ago #

    Thanks agelonwl!

    olyma, your fix didn't work for me (Version 5.0.42). I added the code, but no events show up in the big calendar now for some months.

    -Bri

  11. olyma
    Member
    Posted 2 years ago #

    Sorry it doesn't work on 5.0.42, it does work on 3.0.95. Marcus and agelonwl are saying that the upcoming latest release should have the bug fixed. You might simply want to wait til then.

  12. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    5.0.50 allows this now.

  13. Bri-
    Member
    Posted 2 years ago #

    The new version works. In the settings it says that it determines the order by start date, then event name. Usually, it would be start date, then end date, then event name. So if event A and B start at the same time, event A would be listed first if it ends before event B regardless of the name. Is that how it's currently working?

    -Bri

  14. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    it's either by time or by name (date is irrelevant since they must all be the same day in the calendar cell), ascending or descending order

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic