diff --git a/frontend/src/routes/MonthGrid.svelte b/frontend/src/routes/MonthGrid.svelte index 38c6b08..795df68 100644 --- a/frontend/src/routes/MonthGrid.svelte +++ b/frontend/src/routes/MonthGrid.svelte @@ -5,13 +5,15 @@ let { month, events, - colorFor = () => 'var(--accent)', + colorFor = () => 'var(--primary)', onday = null, + showTitle = true, }: { month: string; events: CalEvent[]; colorFor?: (e: CalEvent) => string; onday?: ((date: string) => void) | null; + showTitle?: boolean; } = $props(); const weeks = $derived(monthWeeks(month)); @@ -30,30 +32,29 @@ return m; }); // Weekday names in the device's language, Sunday first (2026-01-04 was a Sunday). - const names = Array.from({ length: 7 }, (_, i) => - new Date(2026, 0, 4 + i).toLocaleDateString(undefined, { weekday: 'short' }), - ); + const names = Array.from({ length: 7 }, (_, i) => new Date(2026, 0, 4 + i).toLocaleDateString(undefined, { weekday: 'short' })); const today = iso(new Date()); + const longDay = (d: string) => parse(d).toLocaleDateString(undefined, { weekday: 'long', month: 'long', day: 'numeric' }); -
-

{monthLabel(month)}

+
+ {#if showTitle}

{monthLabel(month)}

{/if}
- {#each names as n}
{n}
{/each} + {#each names as n}{/each} {#each weeks as week} {#each week as day} {@const list = byDay.get(day) ?? []} {@const outside = day.slice(0, 7) !== month} {#snippet cell()} - {parse(day).getDate()} + {parse(day).getDate()} {#each list.slice(0, 3) as e (e.id)} {e.title} {/each} - {#if list.length > 3}+{list.length - 3}{/if} + {#if list.length > 3}+{list.length - 3} more{/if} {/snippet} {#if onday} {:else} @@ -65,20 +66,24 @@