Home › Forums › General Issues › Filtering by date › Reply To: Filtering by date
Hi @AdamWebDev
For reference, the date field docs are located here:
http://www.advancedcustomfields.com/resources/field-types/date-picker/
I have not yet used the DATE compare method, and can’t confirm that it works with a custom field value in the format of Y-m-d.
To sort posts based on a date picker value, the value must be saved with the format yymmdd. Is this the save format you are using? Or are you using something else?
Your next issue is that $today is in a format of Y-m-d. These ‘-‘ characters need to be removed and you need to sort by Ymd
Then change your compare type from DATE to NUMERIC, however you may not even need this setting.
Hope that helps.
Thanks
E
Basically, you need to c
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.