
* fix video url * update deploy script for using rsync * remove delete from script * translate resources page * fix images dimensions and favicon * add css optimization plugin and improve images * update project dependencies * refactor lang * post translated to spanish * fix metadata * update dependencies * update dependencies * update dependencies * update to Astro 5.x * format index.astro * Migrate content layer to Astro V5
41 lines
694 B
TypeScript
41 lines
694 B
TypeScript
const months = [
|
|
'January',
|
|
'February',
|
|
'March',
|
|
'April',
|
|
'May',
|
|
'June',
|
|
'July',
|
|
'August',
|
|
'September',
|
|
'October',
|
|
'November',
|
|
'December',
|
|
];
|
|
const meses = [
|
|
'Enero',
|
|
'Febrero',
|
|
'Marzo',
|
|
'Abril',
|
|
'Mayo',
|
|
'Junio',
|
|
'Julio',
|
|
'Agosto',
|
|
'Septiembre',
|
|
'Octubre',
|
|
'Noviembre',
|
|
'Diciembre',
|
|
];
|
|
|
|
export default function formatDate(date: Date | string, lang: string) {
|
|
const newDate = new Date(date);
|
|
const month = months[newDate.getMonth()];
|
|
const mes = meses[newDate.getMonth()];
|
|
const day = newDate.getDate();
|
|
const year = newDate.getFullYear();
|
|
|
|
return lang !== 'es'
|
|
? `${month} ${day}, ${year}`
|
|
: `${day} de ${mes} del ${year}`;
|
|
}
|