2025-02-12 00:00:14 +00:00
|
|
|
<script lang="ts">
|
2025-05-05 17:11:02 +00:00
|
|
|
import {fromPairs, LOCALE, secondsToDate} from "@welshman/lib"
|
2025-02-12 00:00:14 +00:00
|
|
|
import type {TrustedEvent} from "@welshman/util"
|
|
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
event: TrustedEvent
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const {event}: Props = $props()
|
|
|
|
|
const meta = $derived(fromPairs(event.tags) as Record<string, string>)
|
2025-10-06 18:23:19 +00:00
|
|
|
const start = $derived(parseInt(meta.start))
|
2025-02-12 00:00:14 +00:00
|
|
|
</script>
|
|
|
|
|
|
2025-10-06 18:23:19 +00:00
|
|
|
{#if !isNaN(start)}
|
|
|
|
|
{@const startDate = secondsToDate(start)}
|
|
|
|
|
<div
|
2026-06-24 20:56:53 +00:00
|
|
|
class="hidden h-32 w-32 min-w-32 flex-col items-center justify-center gap-1 rounded-2xl bg-surface-more p-2 sm:flex">
|
2025-10-06 18:23:19 +00:00
|
|
|
<strong>{Intl.DateTimeFormat(LOCALE, {month: "short"}).format(startDate)}</strong>
|
|
|
|
|
<span class="text-4xl">{Intl.DateTimeFormat(LOCALE, {day: "numeric"}).format(startDate)}</span>
|
|
|
|
|
<span class="text-xs opacity-75"
|
|
|
|
|
>{Intl.DateTimeFormat(LOCALE, {weekday: "long"}).format(startDate)}</span>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|