Ü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

Time Picker

Zustände

Uhrzeitfeld leer, gefüllt, Fehler, deaktiviert, schreibgeschützt und mit 15-Minuten-Raster.

Code<div class="tc-cluster" style="--tc-gap: 20px; align-items: flex-start"> <div style="width: 140px">{% tc_time_picker# label="Beginn" name="start_empty" %}</div> <div style="width: 140px">{% tc_time_picker# label="Beginn" name="start" value="14:30" %}</div> <div style="width: 140px">{% tc_time_picker# label="Beginn" name="start_error" value="23:30" max="22:00" error="Spätestens 22:00 Uhr." %}</div> <div style="width: 140px">{% tc_time_picker# label="Beginn" name="start_disabled" value="14:30" disabled=True %}</div> <div style="width: 140px">{% tc_time_picker# label="Beginn" name="start_readonly" value="14:30" readonly=True %}</div> <div style="width: 140px">{% tc_time_picker# label="Termin" name="slot" value="09:15" step=900 help="15-Minuten-Raster" %}</div> </div>

Arbeitszeit

zwei Uhrzeitfelder bilden eine Zeitspanne mit berechneter Dauer.

= 8:15 h inkl. 30 min Pause
Code<div style="max-width: 420px"> {% tc_field_label label="Arbeitszeit" %} <div class="tc-cluster" style="--tc-gap: 8px; flex-wrap: nowrap"> <div style="width: 120px">{% tc_time_picker# label="Beginn" hide_label=True name="work_start" value="08:30" %}</div> <span class="tc-text-tertiary" aria-hidden="true">–</span> <div style="width: 120px">{% tc_time_picker# label="Ende" hide_label=True name="work_end" value="16:45" %}</div> <span class="tc-text-body-sm tc-text-secondary"><span class="tc-mono">= 8:15 h</span> inkl. 30 min Pause</span> </div> {% endtc_field_label %} </div>

Rohes HTML und JS-API

tc-time-picker ohne Template-Tag, value/valueAsNumber, show() und tc-change.

show() + 1 h Senden

Code<form id="raw-time-form" class="tc-stack" style="--tc-gap: 16px; max-width: 340px"> <div style="width: 160px"><tc-time-picker id="raw-time" name="begin" label="Beginn" value="14:30" step="900" hour-label="Stunde" minute-label="Minute" now-label="Jetzt" picker-label="Uhrzeit wählen"></tc-time-picker></div> <div class="tc-cluster"> <tc-button id="raw-time-open" variant="outlined" size="sm">show()</tc-button> <tc-button id="raw-time-plus" variant="outlined" size="sm">+ 1 h</tc-button> <tc-button type="submit" size="sm">Senden</tc-button> </div> <pre id="raw-time-log" class="tc-text-mono-sm tc-text-secondary" style="margin: 0; white-space: pre-wrap" aria-live="polite"></pre> </form> <script> (function () { var picker = document.getElementById('raw-time'); var log = document.getElementById('raw-time-log'); var form = document.getElementById('raw-time-form'); document.getElementById('raw-time-open').addEventListener('click', function () { picker.show(); }); document.getElementById('raw-time-plus').addEventListener('click', function () { picker.valueAsNumber = ((picker.valueAsNumber || 0) + 3600000) % 86400000; }); picker.addEventListener('tc-change', function (event) { log.textContent = 'tc-change: ' + JSON.stringify(event.detail); }); form.addEventListener('submit', function (event) { event.preventDefault(); log.textContent = 'FormData: ' + new URLSearchParams(new FormData(form)).toString(); }); })(); </script>

Raster und Grenzen

5-Minuten-Raster, Servicezeit 07:00–19:00 und Sekunden bei step unter 60.

Code<div class="tc-cluster" style="--tc-gap: 20px; align-items: flex-start"> <div style="width: 160px">{% tc_time_picker# label="Termin" name="appointment" value="09:35" step=300 help="5-Minuten-Raster" %}</div> <div style="width: 200px">{% tc_time_picker# label="Rückruf" name="callback" min="07:00" max="19:00" step=900 help="Servicezeit 07:00–19:00" %}</div> <div style="width: 160px">{% tc_time_picker# label="Zeitstempel" name="stamp" value="14:30:15" step=15 %}</div> </div>

API

OptionStandardWerteBeschreibung
label''–Visible label text.
requiredFalse–Mark as required: native required attribute plus a red asterisk.
optionalFalse–Show the "optional" marker after the label (ignored when required).
label_icon''–Explanation shown as a help icon with tooltip after the label.
hide_labelFalse–Keep the label for assistive technology only.
help''–Hint below the control (Figma: Hint / Help Text).
error''–Error message or list of messages (e.g. Django field.errors); sets the error state, aria-invalid and aria-describedby. Replaces the hint while shown.
state''Validation state without an error message: success or warning colour the border and the hint.
name''–Form field name (Django html_name).
value'None'–Current value; dates and numbers are converted to their ISO/text form.
disabledFalse–Disable the control.
readonlyFalse–Read-only: value stays selectable and is submitted.
placeholder''–Placeholder text (never a replacement for the label).
size'md'Height: sm 28, md 36, lg 44 px (match the buttons in the same row).
min''–Earliest allowed value (ISO text or date/datetime/time object).
max''–Latest allowed value (ISO text or date/datetime/time object).
step'None'–Step in seconds, e.g. 300 (5 min) or 900 (15 min); below 60 adds seconds.

Verwendung

{% load components tomcom_theme %} {% tc_time_picker label="…" required="…" %}…{% endtc_time_picker %} {% tc_time_picker# %} {# 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.