mirror of
https://github.com/Techtonic-Fault/homepage.git
synced 2026-01-23 05:26:30 +00:00
Initial commit
This commit is contained in:
20
lib/blog.ts
Normal file
20
lib/blog.ts
Normal 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));
|
||||
}
|
||||
6
lib/utils.ts
Normal file
6
lib/utils.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { clsx, type ClassValue } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
Reference in New Issue
Block a user