Changes
This commit is contained in:
22
src/components/admin/pages/home/EventCard.svelte
Normal file
22
src/components/admin/pages/home/EventCard.svelte
Normal file
@ -0,0 +1,22 @@
|
||||
<script lang="ts">
|
||||
import {Card} from "flowbite-svelte";
|
||||
import {link} from 'svelte-spa-router'
|
||||
import type {ShortEvent} from "../../types/event.js";
|
||||
|
||||
export let event: ShortEvent;
|
||||
|
||||
$: sameDate = new Intl.DateTimeFormat().format(event.start) === new Intl.DateTimeFormat().format(event.end);
|
||||
</script>
|
||||
|
||||
<a href="/event/{event.id}" use:link>
|
||||
<Card class="hover:scale-105 transition">
|
||||
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">{event.name}</h5>
|
||||
{#if !sameDate}
|
||||
<p>Startet: {new Intl.DateTimeFormat().format(event.start)}</p>
|
||||
<p>Endet: {new Intl.DateTimeFormat().format(event.end)}</p>
|
||||
{:else}
|
||||
<p>Am: {new Intl.DateTimeFormat().format(event.start)}</p>
|
||||
<p> </p>
|
||||
{/if}
|
||||
</Card>
|
||||
</a>
|
||||
Reference in New Issue
Block a user