fix(frontend): locale-aware currency input und zentrale formatPriceDisplay #325
No reviewers
Labels
No labels
component/backend
component/docs
component/e2e
component/frontend
component/infra
component/keycloak
prio/high
prio/low
prio/medium
type/bug
type/chore
type/feature
type/refactor
type/test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
WompSchmiede/FamilienFeierPlaner!325
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/locale-currency-input"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
closes #324
Altes Verhalten
Der Preis-Input in form-editor.svelte nutzt
<input type="number" step="0.50">— drei Bugs:,) wird nicht als Dezimaltrenner akzeptiertPreis-Formatierung ist inkonsistent ueber drei Komponenten verteilt:
form-editor.svelte:.toFixed(2)(Punkt-Format)form-fields.svelte:.toLocaleString('de-DE', ...)(hartcodiert)events/[eventId]/+page.svelte: eigeneformatEuroCent()+ 2x inline.toLocaleStringNeues Verhalten
format-currency.ts— zentrale Utility mitparsePriceInput()undformatPriceDisplay(). Automatisch locale-korrekt viaIntl.NumberFormat(keine hardcodierte Locale-Liste).formatPriceDisplayinkludiert EUR-Symbol viastyle: 'currency'.form-editor.svelte—<input type="text" inputmode="decimal">statttype="number". Draft-Tracking waehrend Tippen, erst beionBlurwird nach Cent konvertiert. Ermoeglicht deutsches Komma, select-all+type, begrenzt auf 2 NK-Stellen.form-fields.svelte— 3x.toLocaleString('de-DE')durchformatPriceDisplay(cents, i18n.locale)ersetztevents/[eventId]/+page.svelte—formatEuroCent()delegiert anformatPriceDisplay; 2x inline.toLocaleStringvereinheitlichtBegruendung
Benutzbare Preiseingabe im deutschen Format, locale-aware ohne Wartungsaufwand bei neuen Sprachen.
Test-Hinweise
parsePriceInput(10 Faelle: DE/EN/Tausender/Komma/Punkt/Edge) undformatPriceDisplay(5 Faelle)Checkliste
use:testidan neuen<button>,<a>,<form>-Elementen gesetzt? — nicht relevante2e/specs/angelegt? — nicht relevant