<?php
/**
* reindex after adding or updating this filter
*/
add_filter( 'facetwp_index_row', function( $params, $class ) {
if ( 'date' == $params['facet_name'] ) {
$timestamp = strtotime( $params['facet_value'] );
$formatted = date( 'Y-m-d', $timestamp );
$params['facet_value'] = $formatted; // lower
$params['facet_display_value'] = $formatted; // upper
}
return $params;
}, 10, 2 );