Different view for past events

Home Forums Calendar Products Events Calendar PRO Different view for past events

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #679680
    Christopher
    Participant

    Hello there!
    I would like to add some specific code to the single view, when the event is past (a feedback-form instead of a register form for an upcoming event).
    I tried to do it with the function tribe_is_past, but it didn’t work – somehow it has no effect when used in in the single view.
    I’d appreciate any hint how to manage this issue.
    Thanks in advance!
    Christopher

    #681299
    Brian
    Member

    Christopher,

    Thanks for using the Events Calendar, let me try to give you a hint on how you can do this.

    The tribe_is_past() function is set to “Returns true if the query is set for past events, false otherwise”

    So it does not detect on a single event that it is in the past only in a loop.

    You can use these two functions to get the start and end date of the single event:

    tribe_get_end_date()

    tribe_get_start_date()

    You could then write a conditional statement to compare to the current time with the returned time from those functions.

    You will have to format the time from those functions to be able to compare it to a function like php’s time()

    It may take a couple tries to get the formatting synced up. Let us know if you would like any more hints.

    Thanks!

    #681938
    Christopher
    Participant

    Thank you, Brian!
    That was the key.
    Christopher

    #683785
    Brian
    Member

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need any other on something else please post a new ticket.

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Different view for past events’ is closed to new replies.