feat: better article parsing + html dom base

This commit is contained in:
2026-04-24 23:03:02 +02:00
parent cbab7c74e5
commit 9109678195
11 changed files with 157 additions and 63 deletions
+17
View File
@@ -0,0 +1,17 @@
export function dateFromParts(
year: string | undefined,
month: string | undefined,
day: string | undefined,
): Date {
return new Date(parseInt(year ?? ''), parseInt(month ?? '') - 1, parseInt(day ?? ''))
}
export function simpleDateFormat(date: Date): string {
return (
date.getFullYear() +
'-' +
(date.getMonth() + 1).toString().padStart(2, '0') +
'-' +
date.getDate().toString().padStart(2, '0')
)
}