Posted: May 21, 2024 at 8:00 pm
I’m trying to pass a date to the query below, and it doesn’t recognize the date when I try anything other than the current day. For example, the date below will return everything instead of the events starting from 12-31. Is there something I’m missing when formatting these queries? Thank you. function run_new_event_list_query($eventYear) { $where = array( |
|
Hi there, Take a look at the docs here: When passing a value for Datetime fields you can use either a DBSafeDatetime object, a Unix timestamp or a string in the sites current WP date/time format (which I assume you are example above is not). Something like this should work:
Or, you can use:
The latter just creates a DBSateDateTime for you with the values passed. |
|
Got it, thanks. We were trying to pass the dates as they were being returned by the current time function on this example: https://eventespresso.com/topic/build-an-events-loop-query-in-bricks-builder/ We see now how that won’t work. Ultimately, we now have a pretty slick query function that works with the Bricks Builder loop feature, passing parameters for filtering. We’ll be putting together a post about the implementation soon! |
|
Ohhh! Nice!
Hmmm… I’m going to do some digging into this.
Please do let us know when you publish, I’m always happy to have a read of other implementations and see what people come up with 🙂 |
|
The support post ‘EEM_Event::instance() query on DTT_EVT_start.’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.