ACF date picker condition: show post if less than 2years old

Hi team,

I have been struggling with this terribly. Im trying to only show a post in a looper consumer if my acf field date_acquired is less than 2 years old.

{{dc:acf:post_field field=“date_acquired”}} before ??

How would I format this?

Thanks heaps for your help.
Kelly

Hi Kelly,

Thanks for reaching out.
You need to use the same format set to the Return Format attribute of the Date Picker field. So, if you set the return_format to Y-m-d, you need to use the same format in the condition.

Hope it helps.
Thanks

Thanks tristup.

Date format is d/m/Y. I want it to be two years from the date picker field. How would I condition that?

Hi Kelly,

I am sorry, I might have misunderstood your point here. It seems that you are trying to compare the ACF value with the 2 years back condition. Regretfully, calculation can’t be made with the Dynamic Content to get the 2years back value.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.