chore: merge origin/main into feat/issue-162-korrespondenz-redesign
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 1m30s
CI / Backend Unit Tests (pull_request) Failing after 2m28s
CI / E2E Tests (pull_request) Failing after 1h48m30s
CI / Unit & Component Tests (push) Failing after 1m45s
CI / Backend Unit Tests (push) Failing after 2m34s
CI / E2E Tests (push) Failing after 1h47m38s
Some checks failed
CI / Unit & Component Tests (pull_request) Failing after 1m30s
CI / Backend Unit Tests (pull_request) Failing after 2m28s
CI / E2E Tests (pull_request) Failing after 1h48m30s
CI / Unit & Component Tests (push) Failing after 1m45s
CI / Backend Unit Tests (push) Failing after 2m34s
CI / E2E Tests (push) Failing after 1h47m38s
Resolved conflicts: - messages/de|en|es.json: kept all keys from both sides - DateInput.svelte: kept HEAD API (onchange, not oninput/...rest) to match CorrespondenzFilterControls caller; incorporated main's isCalendarValid helper Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit was merged in pull request #164.
This commit is contained in:
@@ -24,6 +24,16 @@ let {
|
||||
|
||||
let display = $state(isoToGerman(value ?? ''));
|
||||
|
||||
// ─── Validation helper ────────────────────────────────────────────────────
|
||||
function isCalendarValid(iso: string): boolean {
|
||||
if (!iso) return false;
|
||||
const [, mm, dd] = iso.match(/^\d{4}-(\d{2})-(\d{2})$/) ?? [];
|
||||
const month = parseInt(mm, 10);
|
||||
const day = parseInt(dd, 10);
|
||||
return month >= 1 && month <= 12 && day >= 1 && day <= 31;
|
||||
}
|
||||
|
||||
// ─── Input handler ────────────────────────────────────────────────────────
|
||||
function handleInput(e: Event) {
|
||||
const result = handleGermanDateInput(e);
|
||||
display = result.display;
|
||||
@@ -42,14 +52,7 @@ function handleInput(e: Event) {
|
||||
}
|
||||
|
||||
const iso = germanToIso(result.display);
|
||||
if (!iso) {
|
||||
value = '';
|
||||
errorMessage = m.form_date_error();
|
||||
return;
|
||||
}
|
||||
|
||||
const [, mo, d] = iso.split('-').map(Number);
|
||||
if (mo < 1 || mo > 12 || d < 1 || d > 31) {
|
||||
if (!iso || !isCalendarValid(iso)) {
|
||||
value = '';
|
||||
errorMessage = m.form_date_error();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user