Files
maro 45261a0461 Initial commit: ANOUMA website with Payload CMS, WebRTC meetings, and booking system
- Next.js 16 App Router site with the ANOUMA design system
- Payload CMS (PostgreSQL) for offers, events, posts and page content
- WebRTC video-call system with custom signaling server
- SMTP email reminders and booking-request notifications
- Customer accounts, calendar-based availability, and booking workflow
2026-08-25 16:40:51 +02:00

28 lines
905 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/** Day + short month, e.g. { day: "15", month: "SEP" } — for the date badge on event cards. */
export function formatEventDateParts(iso: string) {
const date = new Date(iso);
return {
day: date.toLocaleDateString("de-DE", { day: "2-digit" }),
month: date.toLocaleDateString("de-DE", { month: "short" }).toUpperCase().replace(".", ""),
};
}
export function formatFullDate(iso: string) {
return new Date(iso).toLocaleDateString("de-DE", {
weekday: "long",
day: "2-digit",
month: "long",
year: "numeric",
});
}
export function formatTime(iso: string) {
return new Date(iso).toLocaleTimeString("de-DE", { hour: "2-digit", minute: "2-digit" });
}
export function formatTimeRange(start?: string | null, end?: string | null) {
if (start && end) return `${formatTime(start)} ${formatTime(end)} Uhr`;
if (start) return `${formatTime(start)} Uhr`;
return null;
}