Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Created January 18, 2021 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/4d340101d6158d53e0fddaba68bdd324 to your computer and use it in GitHub Desktop.
Save mgibbs189/4d340101d6158d53e0fddaba68bdd324 to your computer and use it in GitHub Desktop.
FacetWP - translate date picker (3.7.1+)
<?php
// Add to your (child) theme's functions.php
// replace "YOUR_FACET_NAME" with your *actual* facet name
add_filter( 'facetwp_render_output', function( $output ) {
$output['settings']['YOUR_FACET_NAME']['locale'] = [
'weekdays_short' => ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'],
'months_short' => ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'],
'months' => ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
'firstDayOfWeek' => 1
];
return $output;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment