WPFacet date formating

mgibbs189

{{gist file=”gistfile1.php” lang=”php”}}
<?php

function my_facetwp_index_row( $params, $class ) {
if ( ‘keydate’ == $params[‘facet_name’] ) { // 20170823
$val = $params[‘facet_value’];
$fixed = substr( $val, 0, 4 ) . ‘-‘ . substr( $val, 4, 2 ) . ‘-‘ . substr( $val, 6, 2 );
$params[‘facet_value’] = $fixed;
$params[‘facet_display_value’] = $fixed;
}
return $params;
}
add_filter( ‘facetwp_index_row’, ‘my_facetwp_index_row’, 10, 2 );
{{/gist}}