Compare commits

...

2 commits

Author SHA1 Message Date
Benno Tielen
c185e4423a fix: dates
Some checks failed
Deploy / deploy (push) Has been cancelled
2026-06-18 10:16:37 +02:00
Benno Tielen
1f3609fbad fix: two columns 2026-06-18 09:09:34 +02:00
4 changed files with 23 additions and 5 deletions

View file

@ -55,7 +55,6 @@ export default async function GroupPage({ params }: { params: Promise<{slug: str
}
<Section paddingBottom={"small"}>
<Container>
<Row>

View file

@ -5,7 +5,7 @@
}
.col {
flex: 1 1 0;
flex: 1 1 40%;
}
@media screen and (max-width: 1024px) {

View file

@ -77,6 +77,14 @@ export const WithPhoto: Story = {
}
}
export const WithEndDateOnDifferentDay: Story = {
args: {
...Default.args,
date: "2024-12-02T13:00:00Z",
endDateTime: "2024-12-04T14:00:00Z",
},
}
export const WithOccurrences: Story = {
args: {
...Default.args,

View file

@ -1,7 +1,8 @@
/**
* Return a readable date time
* e.G. Samstag 13-01-2024, 12:00 Uhr
* With endDate: Samstag 13-01-2024, 12:00 Uhr bis 14:00 Uhr
* With endDate (same day): Samstag 13-01-2024, 12:00 Uhr bis 14:00 Uhr
* With endDate (other day): Samstag 13-01-2024, 12:00 Uhr bis 15-01-2024, 14:00 Uhr
*/
export const readableDateTime = (date: string, endDate?: string | null) => {
const dateObj = new Date(date);
@ -10,6 +11,16 @@ export const readableDateTime = (date: string, endDate?: string | null) => {
const time = dateObj.toLocaleTimeString("de-DE", { timeStyle: "short", timeZone: "Europe/Berlin" });
const base = `${dayName} ${normalDate}, ${time} Uhr`;
if (!endDate) return base;
const endTime = new Date(endDate).toLocaleTimeString("de-DE", { timeStyle: "short", timeZone: "Europe/Berlin" });
return `${base} bis ${endTime} Uhr`;
const endObj = new Date(endDate);
const endTime = endObj.toLocaleTimeString("de-DE", { timeStyle: "short", timeZone: "Europe/Berlin" });
const isSameDay =
dateObj.toLocaleDateString("de-DE", { timeZone: "Europe/Berlin" }) ===
endObj.toLocaleDateString("de-DE", { timeZone: "Europe/Berlin" });
if (isSameDay) return `${base} bis ${endTime} Uhr`;
const endNormalDate = endObj.toLocaleDateString("de-DE", { dateStyle: "medium" });
return `${base} bis ${endNormalDate}, ${endTime} Uhr`;
}