How to hide past events

Home Forums Calendar Products Events Calendar PRO How to hide past events

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #994352
    Armando
    Participant

    Hello, I am trying to find a way to hide past events. I was searching through the forums here and found this thread: https://theeventscalendar.com/support/forums/topic/how-to-hide-past-events/
    The code that is provided here does exactly what I need it to but for some reason it causes the event start time to disappear. I have tired to look into what is causing this problem with no luck. Is there any way you can help me look into this to figure out what is causing this problem? So for I have realized it is causing an error in the function tribe_events_event_schedule_details but I can seem to figure out why. An alternative solution or way to fix the error would be great! Thanks for any help you can give!

    #994391
    Brian
    Keymaster

    Hi,

    Thanks for using our plugins. I can help out here.

    I tried out that coding and it did not hide my event times, but did prevent all past events from showing.

    Do you have a link to where this is happening and I can take a look?

    Let me know.

    Thanks

    #994493
    Armando
    Participant

    Here is a link to my test site. http://summitldev.wpengine.com/members/broadcast-calendar/today/ It is a highly customized version of my The Events Calendar so it is possible something is affecting the problem but if I don’t use that code then the problem isn’t there. I made it so it only is used on day view so if you click on month view you will see the times will show up properly and that it is also hiding the old events. Depending on what time you look at it. Hope this helps. Thanks for the help.

    #994565
    Brian
    Keymaster

    Hi,

    Thanks for providing more information.

    When I use the link you provide I see this event:

    5:45 pm
    Kuan Yin Rosary
    August 9 @ 5:45 pm

    However, when I scroll back a day and then back to the 9th this is what shows:

    5:00 am
    Decrees
    August 9 @ 5:00 am – 8:00 am

    1:00 pm
    Kuan Yin Rosary
    August 9 @ 1:00 pm – 5:45 pm

    Is that the issue you are seeing? That the start time is not there?

    Is this always just in Day View or does it happen in Month View too with that snippet?

    Let me know and I can try to help out some more. However, I am limited in support customizations and troubleshooting them all the way.

    Thanks

    #994728
    Armando
    Participant

    That is because I have it setup to only use the code if you are on the current day view and haven’t used the navigation. But yes, that is the issue I am having.

    This is incorrect:
    5:45 pm
    Kuan Yin Rosary
    August 9 @ 5:45 pm

    The time should look like this:
    August 9 @ 5:00 am – 8:00 am

    This only happen in day view if you don’t navigate but that is only because I set it up that way. I tested and if I let the code run everywhere it would happen everywhere. Any support you can give would be great! Thanks!

    #994868
    Brian
    Keymaster

    Ok thanks for clarifying that.

    I took another look and cannot figure out why the custom snippet is rewriting the Event Start Dates.

    Unfortunately, I troubleshooted this beyond what I can do for customizations and unable to continue.

    Sorry to disappoint.

    #994870
    Armando
    Participant

    Ok :/

    #995104
    Brian
    Keymaster

    So I thought of this more and came up with coding to manually add the date and that might bypass the issue.

    You could try using the following:

    $datetime_format = 'F j @ H:i';

    $tribe_EventStartDate = tribe_get_event_meta( get_the_ID(), '_EventStartDate', true );
    $date = strtotime( $tribe_EventStartDate );
    echo tribe_event_format_date( $date, true, $datetime_format );

    $tribe__EventEndDate = tribe_get_event_meta( get_the_ID(), '_EventEndDate', true );
    $date = strtotime( $tribe__EventEndDate );
    echo tribe_event_format_date( $date, true, $datetime_format );

    Those two echo functions with display the Start and End Date. You would have to replace our functions with these, but it could work.

    You could also change the datetime_format variable too.

    Hopefully that helps.

    Cheers

    #999114
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘How to hide past events’ is closed to new replies.