Meta query with JetEngine and DATE

Hi!

I made a CPT with Jetengine. All of post has date value.
I will have 3 days programs, and I want to list 3 tabs separately 3 days program.
I tried to using Meta query filter, by date, but it nothing listing (I have 3 test post for this date!)

What do I wrong?

image

Hey @simplecreative,

without having a look at the exact setup and completely understanding your use case I am not sure if these are the only issues but:

  1. The Meta key you are using in the meta query has to be just program-datum.
  2. The Meta value you’re using is invalid. You should either just use something like {current_date:Ymd} (the date format depends on the way JE stores the date field in the database) if you want to fetch posts for the current date or something like 20231107 (again the date format depends on the way JE stores the date field in the database) if you want to fetch posts for a specific date.

Best,

André

Hi there,

your settings are correct.

Bricks is rendering {je_cpt_date} and {je_cpt_date:format} in the same manner as {current_date} - Returns the current date with the format defined at WordPress > Settings > General > Date Format.

So if you want to compare date value from CPT you need to specify format jet engine meta field as well as current date field.

for example

{je_cpt_date:Ymd} <= {current_date:Ymd}.

Your jet engine meta field should be set to save as timestamp.

1 Like

Thanks your time Martin!

Could you help me some more, because I dont understand exactly, what do you want say. :slight_smile:

1.) Yes, I set up in metafiled the “timestap” function.

Do I understand clearly, I have to change the {current:date:xxxxxx} value for ??? what?

The day format in WP settings is same, what I want (and render in frontend good, if I put it a simple query dynamic data.) Only not work IF i want to use it, like “filter” in query.

In your Meta query compare

Meta key {je_cpt_date:Ymd}
Meta value {current_date:Ymd}

Thanks you time. I’m sad, not won this. :frowning:

I tried lots of scenario,

  • with or without “{}”
  • Different date formats
  • I meta key only program-datum key without je_… but nothing.
    And these combinations…

image

You need to use exactly these formats.

{je_programok_program-datum:Ydm}

{current_date:Ydm}

this is wrong je_programok_program-datum:2023.11.07. also you cannot specify exact date inside. After colon you need to place date format.

Please read documentation

Hey @simplecreative,

using a dynamic tag as the meta key as @MartinWB suggests is not correct. Please have a look at my previous reply.

Best,

André

:sweat_smile: ou. I thought is dynamic data compare.

So based on @simplecreative Date format setting it should be?

Meta value = program-datum
Meta key = {current_date:Y.m.d. H:i}

I found the problem.
When I turn off the timestamp option in Jetengine, the meta query like filter is working.

I couldn’t figure out, where is the problem or bug. Is in the Bricks or in Jetengine.

image