Kalender: Monat in jeder Tagesüberschrift anzeigen

This commit is contained in:
torsten 2026-11-19 17:11:35 +01:00
parent 9d34dd9bda
commit 9425b1dcf1
3 changed files with 21 additions and 6 deletions

View file

@ -366,6 +366,12 @@ function fmt_month(string $iso): string
return $months[(int) date_obj($iso)->format('n')] . ' ' . date_obj($iso)->format('Y');
}
function fmt_month_short(string $iso): string
{
$months = ['', 'Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'];
return $months[(int) date_obj($iso)->format('n')];
}
function fmt_weekday_short(string $iso): string
{
$days = ['', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'];

View file

@ -97,8 +97,11 @@ $minWidth = match ($view) {
<div class="cal-head__day<?= $day['is_today'] ? ' is-today' : '' ?><?= $day['is_weekend'] ? ' is-weekend' : '' ?>">
<span class="cal-head__weekday"><?= e($day['weekday']) ?></span>
<span class="cal-head__num"><?= (int) $day['day'] ?></span>
<?php if ($view === 'day' || ($view === 'month' && $day['is_first_of_month']) || ($view === 'week' && $day['is_first_of_month'])): ?>
<span class="cal-head__month"><?= e(fmt_month($day['iso'])) ?></span>
<?php // Monat in jeder Tagesüberschrift, damit er auch in der Handy-Ansicht
// ohne das große Monats-Label erkennbar bleibt. ?>
<span class="cal-head__month<?= $day['is_first_of_month'] ? ' is-month-start' : '' ?>"><?= e($view === 'day' ? fmt_month($day['iso']) : fmt_month_short($day['iso'])) ?></span>
<?php if ($view !== 'day' && $day['is_first_of_month']): ?>
<span class="cal-head__year"><?= e(date_obj($day['iso'])->format('Y')) ?></span>
<?php endif; ?>
</div>
<?php endforeach; ?>

View file

@ -494,12 +494,15 @@ a .ico, button .ico { pointer-events: none; }
}
.cal-head__weekday { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.cal-head__num { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--ink); margin-top: 2px; }
.cal-head__month { font-size: .6rem; color: var(--muted); margin-top: 1px; white-space: nowrap; }
/* Aktuell angezeigter Monat/Jahr im Kalenderkopf deutlich hervorheben. */
/* Monatskürzel in jeder Tagesüberschrift – dezent, beim Monatswechsel hervorgehoben. */
.cal-head__month {
font-family: var(--font-display); font-size: .74rem; font-weight: 800;
letter-spacing: .02em; color: var(--brand-800); text-transform: none;
font-family: var(--font-display); font-size: .64rem; font-weight: 700;
letter-spacing: .02em; color: var(--muted); margin-top: 1px;
white-space: nowrap; text-transform: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.cal-head__month.is-month-start { font-size: .72rem; font-weight: 800; color: var(--brand-800); }
.cal-head__year { font-family: var(--font-display); font-size: .58rem; font-weight: 700; color: var(--brand-800); line-height: 1.05; }
.cal-head__day.is-today .cal-head__month { color: var(--brand-700); }
.cal-head__day.is-weekend { background: #fbfdff; }
.cal-head__day.is-today { background: var(--ice-100); }
.cal-head__day.is-today .cal-head__num, .cal-head__day.is-today .cal-head__weekday { color: var(--brand-700); }
@ -930,6 +933,9 @@ a .ico, button .ico { pointer-events: none; }
.cal-label__add { display: none; }
.cal-head__weekday { font-size: .6rem; }
.cal-head__num { font-size: .92rem; }
.cal-head__month { font-size: .6rem; }
.cal-head__month.is-month-start { font-size: .66rem; }
.cal-head__year { font-size: .54rem; }
.trailer-grid { grid-template-columns: 1fr; }
.event-row__date { width: 98px; }
.event-row .btn { display: none; }