const dateToLettersFormat = function (date) { //receives just 2024-08-20 or 2024/08/20 or 20-08-2024 or 20/08/2024 format
const months = ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']
var dateArray = date.split('-');
dateArray = date.split('/');
const month = months[parseInt(dateArray[1]) - 1];
const year = dateArray.find((d) => d.length > 3);
const day = dateArray.find((d) => d.length < 3 && d !== dateArray[1]);
return day + ' de ' + month + ' del ' + year;
}
const dateToLettersFormat = function (date) { //receives just 2024-08-20 or 2024/08/20 or 20-08-2024 or 20/08/2024 format
const months = ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre']
var dateArray = date.split('-');
dateArray = date.split('/');
const month = months[parseInt(dateArray[1]) - 1];
const year = dateArray.find((d) => d.length > 3);
const day = dateArray.find((d) => d.length < 3 && d !== dateArray[1]);
return day + ' de ' + month + ' del ' + year;
}