Machine-translated – improvements welcome. Suggest an improvement
Date¶
DatumEingabe (#1496) is Ablago's date field: you type as usual in the browser's date field and pick in a calendar of its own that shows the week number (ISO 8601) before each week – so “end of week 50” is quick to enter. It sits in a Field and takes its connection (id, aria-describedby, aria-invalid go to the input).
What it is for¶
For every date someone enters, also month and year only (nurMonat). A period (“3 months”) is an input with a unit.
Where it is used: wherever a date is entered (#1532) – date fields of a folder, package actions (e.g. “Mark as paid”), the dialogs “Assign task” and “Remind”, in the workbench (among others deletion log, data access request, field settings and default value of a folder type, conditions of a view, package settings) and in the profile (API keys, absence). There is no <input type="date"> of its own outside the component; a test (baustein-datum.test.ts) watches for it. Date with time (maintenance mode) stays a browser field.
Matching patterns in the pattern catalogue: A8 · Date field with calendar and calendar week, C18 · Position of menus: below if there is room, otherwise above, never over the assistant, C4 · Form rows.
How to use it¶
Decision (#1496): the calendar opens on a click into the field, the keyboard stays direct.
| With | How it works |
|---|---|
| Mouse | A click into day, month or year opens the calendar without taking the focus: whoever types next types into the field, and the calendar follows the typed date. A click on a day picks it; “Today” picks today. A click elsewhere closes it. |
| Keyboard | Nothing opens by itself; Tab moves on and closes an open calendar. Alt + Down arrow or the calendar button at the right of the field open it with the focus on the day: arrow keys move, Home/End jump to the start or end of the week, Page Up/Down turn a month (with Shift a year), Enter picks, Esc closes and returns the focus to the field. |
| Touch | A tap into the field opens the system's picker as before; the calendar with week numbers opens from the calendar button (44 × 44 px). On narrow screens the calendar is a sheet from the bottom. |
The browser's calendar icon is hidden in Chromium and Safari; the button of its own takes its place.
What it means¶
In the calendar the chosen day is solid blue, today is highlighted, days outside the limits (min, max) are struck through and cannot be picked, days of the neighbouring month are quiet. The week number stands before each week.
Week number: kalenderwoche(iso) in shared/src/kalender.ts – weeks start on Monday, week 1 contains the first Thursday of the year (29 Dec 2025 is in week 1, 1 Jan 2027 in week 53). The column is called “Wk” (German “KW”), for screen readers “Week 50”.
Position¶
Placed like the menus (#1532, #1556, web/src/bausteine/menue/lage.ts, see Menu): the calendar opens below the field if there is room, otherwise above it – never over the assistant in the bottom right corner. Horizontally it is left-aligned with the field if it fits into the window there, otherwise right-aligned; if neither fits, 8 px from the window edge. It is fixed in the window and never lengthens a column. On phones the bottom sheet stays.
States¶
| State | How it comes about | How it looks |
|---|---|---|
| empty, filled | wert |
date field like a field, the calendar button on the right |
| calendar open | click into the field, calendar button, Alt + Down arrow | calendar with month, week numbers and “Today” below or above the field |
| chosen day | wert |
solid blue (--akzent) |
| day under the mouse | – | surface --senke |
| day with keyboard focus | – | 2 px ring in --akzent |
| day outside the limits | min, max |
quiet and struck through, cannot be picked |
| month only | nurMonat |
text field “MM/YYYY”, same calendar button |
| disabled | disabled |
field and calendar button disabled |
Accessibility¶
- The input gets
id,aria-describedbyandaria-invalidfrom the field frame; without a visible label it needsaria-label. - The calendar button has
aria-haspopup="dialog"andaria-expanded; the calendar is arole="dialog"with a name, the days stand in arole="grid"named after the month. - Every day has the full date as its name, the chosen one
aria-selected, todayaria-current="date", disabled daysaria-disabled. - The month is announced when turning pages (
aria-live="polite"); the week number is “Week 50” for screen readers.
Code¶
import { DatumEingabe, Feld } from '../bausteine';
<Feld beschriftung={t('…faellig')}>
<DatumEingabe wert={datum} setze={setDatum} />
</Feld>
// In the field frame as a function when the connection is passed on:
<Feld beschriftung={feldLabel(f)}>{(v) => <DatumEingabe {...v} wert={roh} setze={setze} min={heute} />}</Feld>
| Property | Meaning |
|---|---|
wert |
YYYY-MM-DD or empty – as with the browser's date field |
setze |
receives the new value (also empty when the person clears the field) |
min, max |
limits; days outside are disabled in the calendar (struck through) |
disabled |
disabled: field and calendar button |
aria-label |
name when no visible label points to the input |
nurMonat |
month and year only (#1722, date field with genauigkeit: monat): a text field “MM/YYYY” instead of the browser's date field, same calendar button; a day in the calendar picks its month. setze gets the last day of the month (2028-04-30) or – as long as the text can't be read – the text, so that validation reports it |
Files and tests¶
- Component:
web/src/bausteine/datum/Datum.tsx, look:Datum.module.css; week number:shared/src/kalender.ts; position:web/src/bausteine/menue/lage.ts - Pattern page:
web/src/bausteine/datum/muster.tsx - Test:
web/test/baustein-datum.test.ts

