Übersicht FarbenTypografieAbstände & RasterIcons ButtonButton GroupIcon ButtonLink CheckboxCheckbox GroupChipChip GroupComboboxDate PickerFieldField LabelFieldsFile UploadFormForm SectionInputInput GroupOTP InputPasswordRadioRadio GroupRange SliderReset ButtonSave ButtonSearchSegmented ControlSelectSliderSwitchTextareaTime Picker AvatarAvatar GroupBadgeChartCode BlockCopy ValueData TableInline StatKey ValueList GroupList RowsMeta ItemQR CodeStatStat StripTableTag AlertEmpty StateGuideLive StatusMessagesProgressSkeletonToast DialogDrawerDropdownMenuMenu ItemPopoverTooltip BreadcrumbContent NavigationDate NavigationPaginationSidebarStepperTabsTheme SwitchTopbar AccordionAccordion ItemApp ShellCardDividerFooterPage HeaderSection HeaderSplit Panel DashboardListeFormularDetailansichtEinstellungenMehrschritt-AssistentLeerer StartLoginFehlerseite IconsMusterAdmin

Date Navigation

Zeiträume

Tag, Woche, Monat mit Kalenderwoche in Mono; „Heute“ springt zurück, Klick aufs Datum öffnet den Kalender.

Code<div class="tc-stack" style="--tc-gap: 20px"> {% tc_date_navigation# date="2026-11-25" period="day" today_label="Heute" periods='[["day", "Tag"], ["week", "Woche"], ["month", "Monat"]]' week_format="KW %(week)s" %} {% tc_date_navigation# date="2026-11-25" period="week" today_label="Heute" periods='[["day", "Tag"], ["week", "Woche"], ["month", "Monat"]]' week_format="KW %(week)s" %} {% tc_date_navigation# date="2026-11-25" period="month" today_label="Heute" week=False periods='[["day", "Tag"], ["week", "Woche"], ["month", "Monat"]]' week_format="KW %(week)s" %} </div>

HTMX

Pfeile, „Heute“ und Kalender laden nur die Einträge nach; Tastatur ← → blättern, T = heute.

Code{% comment %} {% tc_date_navigation# date=day period=period get_url=entries_url target="entries" today_label="Heute" periods='[["day", "Tag"], ["week", "Woche"]]' week_format="KW %(week)s" %} Requests carry hx-vals {"date": "2026-11-26", "period": "day"}; the view returns the entry list. Link mode: href="/zeiten/{date}/?ansicht={period}" or the current query string (default). {% endcomment %} <div style="display: flex; justify-content: center"> {% tc_date_navigation# date="2026-11-25" today_label="Heute" periods="" week_format="KW %(week)s" %} </div>

HTML und JS-API

<tc-date-navigation date period> baut Pfeile, „Heute“ und Ansichten selbst; ohne href meldet tc-change das neue Datum.

Code<div class="tc-stack" style="--tc-gap: 12px"> <tc-date-navigation id="raw-date" date="2026-11-25" period="week" periods="day:Tag,week:Woche" week-format="KW %(week)s" today-label="Heute"></tc-date-navigation> <span id="raw-date-log" class="tc-text-body-sm tc-text-secondary" aria-live="polite"></span> </div> <script> (function () { document.getElementById('raw-date').addEventListener('tc-change', function (event) { document.getElementById('raw-date-log').textContent = 'tc-change: ' + event.detail.date + ' (' + event.detail.period + ')'; }); })(); </script>

API

OptionStandardWerteBeschreibung
date'None'–Selected date (date, datetime or ISO string); default today.
period'day'Day, week, month or year.
periods"('day', 'week', 'month')"–Choices of the view switch as names or (value, label); empty hides it.
href''–Link pattern with {date} (ISO) and {period}; default: current query with both replaced.
date_param'date'–Date parameter name.
period_param'period'–Period parameter name.
todayTrue–Show the "Today" button.
weekTrue–Show the calendar week under the label.
pickerTrue–Clicking the label opens the calendar (theme date picker without field).
label''–Override the generated date label.
today_label''–Text of the today button (default "Today").
week_format''–Calendar week text, e.g. "KW %(week)s" (default "CW %(week)s").

Verwendung

{% load components tomcom_theme %} {% tc_date_navigation date="…" period="…" %}…{% endtc_date_navigation %} {% tc_date_navigation# %} {# inline form without content #}

Zusätzliche Attribute (z. B. class, aria-*, data-*) und HTMX-Kurzformen (get, post, get_url, post_url, target, swap, trigger, confirm) werden an das Element „root“ durchgereicht.