Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Alison Miller

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.

1 month ago
Alison Miller

Edit: “20020202” instead of “2002020”, but the issue stands

1 month ago
Stefan van den Dungen Gronovius
Developer

When you use the ACF column for that field (prefixed with an ACF green logo) instead of using the Custom Field column, that date format should automatically be recognized by our plugin. There is not way to change this when you using the Custom Field column.

4 weeks ago
Alison Miller

Hello Stefan,

Thanks for your response. We are currently using the ACF field column type in the plugin settings, but it doesn’t seem to be properly detecting the date format like you said.

We did also look into using the Custom Field column type instead, but it only has 3 options for the “Date Save Format”, which were Y-m-d, ISO, and timestamp. We tested with the Y-m-d setting but it wasn’t able to read the dates and as a result no years appeared in the filter dropdown.

Is there a way to add other date formats to the “Date Save Format” option, or otherwise some way to get the ACF column type to detect the Ymd format used?

3 weeks, 6 days ago
Alison Miller

Hi there,

Our issue is still unresolved, so why would it be marked as “solved”? Can we please get a response to our previous question?

2 weeks, 6 days ago
Stefan van den Dungen Gronovius
Developer

Sorry for marking the issue as resolved. I was able to reproduce the issue with the Date field when using the year filter and the provided date examples. The issue will be fixed in the next minor release. If you want the patched version right away, please message me at support@admincolumns.com and I’ll send you the latest build.

2 weeks, 6 days ago

You must be logged in to reply to this topic.