All Topics
Issue filtering dates with “Ymd” format
We’ve encountered an issue with filtering dates without separators. One of our client sites has a custom post type with a date postmeta field added via ACF. The dates are stored in “Ymd” format (yyyymmdd) and the “Filter by” option is set to “Yearly”.
When filtering by certain years, we are regularly seeing results not from the selected year appearing. We found that the filter is checking the entire date string for a match. For example, filtering “2020” will return results like “20220202” and “2002020” since they contain “2020”.
Is there a filter/hook or some other option somewhere that would let us modify this behavior? Please advise.
You must be logged in to reply to this topic.