• Resolved John

    (@dv1961)


    I’m using Elementor + Jetengine to create post lists. I’d like to display Events Manager events. How to hide past events? Is _event_start_date saved as a timestamp? That seems to be what Jetengine needs.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The _event_start_date is stored as a date. Here’s an example: 2023-09-08

    I think this would work fine in JetEngine. They are probably using a mysql query and that would work with this format as in the example here: https://learnsql.com/cookbook/how-to-order-by-date-in-mysql/

    Thread Starter John

    (@dv1961)

    Thanks for replying, but I don’t understand what the page you link to is telling me to do.

    Crocoblock say that the Jetengine query builder will ignore past events if _event_start_date is stored as a timestamp. The meta query clause asks what type of data is stored in the meta field. ‘Date’ is an option but it doesn’t seem to work – past events are displayed. I’ll reply to Crocoblock, tell them the data type is ‘date’ and let you know what they say.

    You can tell them the dates are in the format Y-m-d

    Thread Starter John

    (@dv1961)

    Crocoblock came up with sql query like this:

    SELECT *
    FROM {prefix}posts AS posts
    INNER JOIN wp_em_events AS events ON posts.ID = events.post_id
    INNER JOIN wp_term_relationships AS term_relationship ON term_relationship.object_id = posts.ID
    WHERE posts.post_type = 'event'
    AND term_relationship.term_taxonomy_id = 161
    AND posts.post_status = 'publish'
    AND events.event_start_date >= CURDATE()

    This give a list of events that can be used in a jetengine widget, the event start date is greater than or equal to today, and in this case the list is restricted one event category.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Timestamp?’ is closed to new replies.