SOLVED: Current Date condition not working with ACF Options Page Repeater

I have a repeater from an ACF options page that has a date field. I can get the repeater to work in the query loop but when I add a condition to hide items after the date has passed, all of the items disappear. Here’s a screenshot of my settings. Am I doing something wrong?

Screen Shot 2024-01-19 at 9.26.37 PM

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: Link to a page that illustrates this issue
Video: Short screen recording that illustrates this issue (free tool: jam.dev)

[Please describe this bug in as much detail as possible so we can replicate & debug this bug]

Hi @markballard,

Could you maybe output both DD tags in a basic text element to see what’s the value returned by both?

It’s returning exactly what’s expected. {current_date:m-d-Y} returns today’s date 01-23-2024 and {acf_special_dates_date:m-d-Y} returns the correct date of the date field in the same format.

One thing that’s strange is if I change it to <= it shows items the items with dates in the past so that’s working correctly. Not sure why the future dates aren’t working though.

Hi,

Please try changing it to {acf_special_dates_date:Ymd} and {current_date:Ymd} when comparing as they are strings.

Or, you can use {acf_special_dates_date:timestamp} and {current_date:timestamp}

Example:
In PHP, when you comparing
“01-25-2023” >= “01-20-2024”
You will get true even though 01-25-2023 is in Year 2023.

Regards,
Jenn

Thanks Jenn! I had already tried it without the dashes, and just tried :timestamp but it doesn’t work either. I usually compare date fields using meta query and thought it might work in a repeater as well but I guess it doesn’t.

Hi @markballard ,

If in this case, please provide admin access and send to help@bricksbuilder.io so we can check.
Please include this forum thread URL as a reference too.

Regards,
Jenn

Thanks Jenn! Email sent.

Update: This was replied in the email in January.

The condition will be executed before rendering the element/query. So you can’t get the dynamic value there

You should adjust it like this.

image

Regards,
Jenn