Initial commit

This commit is contained in:
Francesco
2025-05-14 14:35:15 +02:00
commit c482b6b254
130 changed files with 13171 additions and 0 deletions

20
lib/blog.ts Normal file
View File

@@ -0,0 +1,20 @@
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));
}