mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 11:36:05 +00:00
fix(trips): the trip form drops its complaint once you edit, and the typed date hint follows your language
"Title is required" stayed on screen after the title was typed, until the next save. Any edit in the trip form, desktop and phone, now clears the last save's complaint; the next save checks again. The keyboard date field always hinted DD.MM.YYYY, while it was filled and read back in the user's own order: a Korean user saw "2026. 12. 10." under a German hint. The hint is now the locale's own pattern (YYYY. MM. DD. in Korean, MM/DD/YYYY in US English), and the field's name is translated. Refs #2604
This commit is contained in:
@@ -223,7 +223,9 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
|
||||
}
|
||||
}
|
||||
|
||||
const update = (field, value) => setFormData(prev => {
|
||||
// An edit answers whatever the last save complained about, so the complaint
|
||||
// goes with it rather than standing over the fixed field until the next save.
|
||||
const update = (field, value) => { setError(''); setFormData(prev => {
|
||||
const next = { ...prev, [field]: value }
|
||||
if (field === 'start_date' && value) {
|
||||
if (!prev.end_date || prev.end_date < value) {
|
||||
@@ -235,7 +237,7 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
|
||||
}
|
||||
}
|
||||
return next
|
||||
})
|
||||
}) }
|
||||
|
||||
/* The dashboard's shapes, in the app's own tokens.
|
||||
`.trek-dash` deliberately scopes its palette to that page, so none of its
|
||||
|
||||
Reference in New Issue
Block a user