feat: cache marka api responses

This commit is contained in:
Max Richter
2025-11-04 12:09:17 +01:00
parent bb4e895770
commit fea9b69d4d
9 changed files with 163 additions and 98 deletions

View File

@@ -1,4 +1,13 @@
export function formatDate(date: Date): string {
export function formatDate(date?: string | Date): string {
if (!date) return "";
if (typeof date === "string") {
try {
const d = new Date(date);
return formatDate(d);
} catch (_e) {
return "";
}
}
const options = { year: "numeric", month: "long", day: "numeric" } as const;
return new Intl.DateTimeFormat("en-US", options).format(date);
}