Jahreszahlen in Datumsfeldern haben vier Stellen
Ein <input type="date"> ohne max nimmt Jahreszahlen bis 275760 an. Jedes Datumsfeld laeuft jetzt ueber DateField: - min 1900-01-01 und max 2099-12-31 als Vorgabe; mit vierstelligem max begrenzt der Browser das Jahressegment schon beim Tippen. Eigene Schranken des Aufrufers gehen vor. - Eine Jahreszahl mit mehr als vier Stellen wird nie gemeldet: das Formular behaelt seinen letzten gueltigen Stand, das Feld zeigt "Die Jahreszahl hat vier Stellen." Der Tippstand bleibt im Bauteil, sonst zeigte das Feld etwas anderes, als das Formular enthaelt. - 34 Aufrufstellen von TextField type="date" auf DateField umgestellt; der Stichtag im Organigramm (ein blankes input) bekommt dieselben Schranken. Geprueft: lint, tsc, types:check, 825 Tests (zwei neue fuer DateField), Waechter.
This commit is contained in:
@@ -2,7 +2,7 @@ import { SvNummerField } from "@/components/employees/SvNummerField";
|
||||
import { TitleFields } from "@/components/employees/TitleFields";
|
||||
import { ZustaendigeHrField } from "@/components/employees/ZustaendigeHrField";
|
||||
import { CountryPicker } from "@/components/ui/CountryPicker";
|
||||
import { Field, SelectField, TextField } from "@/components/ui/Field";
|
||||
import { DateField, Field, SelectField, TextField } from "@/components/ui/Field";
|
||||
import { brauchtAufenthaltstitel, UN_COUNTRIES } from "@/lib/countries";
|
||||
import { PersonalnummerField } from "./PersonalnummerField";
|
||||
import type { HireDraftData } from "./types";
|
||||
@@ -62,7 +62,7 @@ export function StepPerson({ draft, update, locations, onNummerBefund, nummerGes
|
||||
{ value: "w", label: "weiblich" },
|
||||
]}
|
||||
/>
|
||||
<TextField label="Geburtsdatum" required type="date" value={draft.birthDate} onChange={(birthDate) => update({ birthDate })} />
|
||||
<DateField label="Geburtsdatum" required value={draft.birthDate} onChange={(birthDate) => update({ birthDate })} />
|
||||
</div>
|
||||
<SvNummerField
|
||||
value={draft.svNummer}
|
||||
@@ -102,9 +102,8 @@ export function StepPerson({ draft, update, locations, onNummerBefund, nummerGes
|
||||
]}
|
||||
/>
|
||||
{draft.hatAufenthaltstitel && (
|
||||
<TextField
|
||||
<DateField
|
||||
label="Aufenthaltstitel gültig bis"
|
||||
type="date"
|
||||
value={draft.aufenthaltstitelBis}
|
||||
onChange={(aufenthaltstitelBis) => update({ aufenthaltstitelBis })}
|
||||
hint="Optional. Leer lassen, wenn unbefristet."
|
||||
|
||||
Reference in New Issue
Block a user