Migrate date precision handling tests

Update park and ride submission forms to support and persist all new date precision options (exact, month, year, decade, century, approximate), ensure default and validation align with backend, and verify submissions save without errors. Includes front-end tests scaffolding and adjustments to submission helpers to store updated precision fields.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-11 22:11:16 +00:00
parent d0c613031e
commit dce8747651
11 changed files with 17 additions and 17 deletions

View File

@@ -405,7 +405,7 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }:
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<FlexibleDateInput
value={watch('opening_date') ? parseDateOnly(watch('opening_date')!) : undefined}
precision={(watch('opening_date_precision') as DatePrecision) || 'day'}
precision={(watch('opening_date_precision') as DatePrecision) || 'exact'}
onChange={(date, precision) => {
setValue('opening_date', date ? toDateWithPrecision(date, precision) : undefined);
setValue('opening_date_precision', precision);
@@ -418,7 +418,7 @@ export function ParkForm({ onSubmit, onCancel, initialData, isEditing = false }:
<FlexibleDateInput
value={watch('closing_date') ? parseDateOnly(watch('closing_date')!) : undefined}
precision={(watch('closing_date_precision') as DatePrecision) || 'day'}
precision={(watch('closing_date_precision') as DatePrecision) || 'exact'}
onChange={(date, precision) => {
setValue('closing_date', date ? toDateWithPrecision(date, precision) : undefined);
setValue('closing_date_precision', precision);