form guarda y estadisticas
This commit is contained in:
@@ -161,7 +161,21 @@ export function CreateTrainingForm({
|
||||
<FormField control={form.control} name="visitDate" render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormLabel>Fecha de la visita</FormLabel>
|
||||
<FormControl><Input type="date" {...field} value={field.value ? new Date(field.value).toISOString().split('T')[0] : ''} /></FormControl>
|
||||
<FormControl>
|
||||
<Input
|
||||
type="date"
|
||||
value={field.value ? new Date(field.value).toISOString().split('T')[0] : ''}
|
||||
onChange={(e) => {
|
||||
// Convert YYYY-MM-DD to ISO 8601 string
|
||||
const dateValue = e.target.value;
|
||||
if (dateValue) {
|
||||
field.onChange(new Date(dateValue).toISOString());
|
||||
} else {
|
||||
field.onChange('');
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)} />
|
||||
|
||||
Reference in New Issue
Block a user