CAMBIAR IDIOMA DE CALEMDARIO EN ELEMENTOR

/**
* Traducción de los textos de calendario
*/
add_action(‘wp_footer’, function () {
if ( is_page( 112 ) ) {

// Do this

} elseif ( is_page( 118 ) ) {

// Do that

} else {

return;
}
?>
<script>
jQuery( document ).ready( function( $ ){
function waitForFlatpicker( callback ) {
if ( typeof window.flatpickr !== ‘function’ ) {
setTimeout( function() { waitForFlatpicker( callback ) }, 2 );
}
callback();
}
waitForFlatpicker( function(){
flatpickr.l10ns.pt = {
weekdays: {
shorthand: [“Dom”, “Lun”, “Mar”, “Mier”, “Jue”, “Vie”, “Sab”],
longhand: [
“Domingo”,
“Lunes”,
“Martes”,
“Miércoles”,
“Jueves”,
“Viernes”,
“Sábado”,
],
},
months: {
shorthand: [
“Ene”,
“Feb”,
“Mar”,
“Abr”,
“May”,
“Jun”,
“Jul”,
“Ago”,
“Sep”,
“Oct”,
“Nov”,
“Dic”,
],
longhand: [
“Enero”,
“Febrero”,
“Marzo”,
“Abril”,
“Mayo”,
“Junio”,
“Julio”,
“Agosto”,
“Septiembre”,
“Octubre”,
“Noviembre”,
“Diciembre”,
],
},
rangeSeparator: ” até “,
};
//set translations
flatpickr.localize(flatpickr.l10ns.pt);
flatpickr(‘.elementor-date-field’);
//set format
setTimeout( function(){
$(‘.elementor-date-field’).each(function(){ flatpickr( $(this)[0] ).set(‘dateFormat’, ‘d/m/Y’);});
}, 1000 );
});
});
</script>
<?php
} );

Entradas relacionadas

247 comentarios

Deja tu comentario