I have a very simple event system made with Bricks and JetEngine. I made several blocks to query future and past events and everything works fine. The problem appears when I want to show Today’s events.
Meta key, which in my case is “event-date”, is saved in timestamp format (it is a JetEngine field “Date”)
Meta value {current_date} is set as a timestamp too.
Everything looks ok, however, the query is empty. I asked JetEngine support about this issue and there is a problem:
Though both fields are saved as timestamps, JetEngine saves “evet-date” at the beginning of the day: 2024-02-03 00:00. And {current_date} gives a timestamp of the current moment, like 2024-02-03 09:34.
Those two fields are not equal and that is why the query is empty.
Obviously you need both in the same format. I’d use {current_date:Ymd} that should return 20240203 then you need to extract the same format from Jetengine - sorry I don’t use that so can’t offer anything but I’m sure there must be options to save in Ymd format.
BTW {current_date:timestamp} returns a value like 1706967806 so not ideal for this.
I tried different options, but none of them worked. I guess you have to use timestamp with the JetEngint date field:
“If this option is enabled date will be saved in database Unix timestamp. Toggle it if you need to sort or query posts by date” (this is JE date field explanation)
But I found another way - JetEngine has its own query builder module (somehow I missed that functionality). You can create your query and then use it with Bricks. That solved my problem.