const months = { "gennaio": 0, "febbraio": 1, "marzo": 2, "aprile": 3, "maggio": 4, "giugno": 5, "luglio": 6, "agosto": 7, "settembre": 8, "ottobre": 9, "novembre": 10, "dicembre": 11, } export function parsePostDate(date: string) { const [day, month, year] = date.split(" "); const monthIndex = months[month.toLowerCase() as keyof typeof months]; return new Date(parseInt(year), monthIndex, parseInt(day)); }