Just as an update to this I had to alter the function to make this work, see the below:
function acf_smart_dates($field) {
if ($field['value']) {
$date = DateTime::createFromFormat('d/m/Y', $field['value']);
$field['value'] = date_format($date, 'Ymd');
}
return $field;
}
add_filter('acf/prepare_field/type=date_picker','acf_smart_dates');
Hi Matt,
It turns our that a function I had setup to populate one of the dropdowns was causing the issue. The function used WP_query to pull back a custom post type.
I altered this this to get_posts and it started working.
I have no idea why and not sure if this is the right way to fix it but it did the job so I won’t argue. 🙂
Hope this helps in some way.