mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 04:11:13 -05:00
Refactor: Implement datetime standardization
This commit is contained in:
@@ -19,6 +19,7 @@ import { Combobox } from '@/components/ui/combobox';
|
||||
import { SlugField } from '@/components/ui/slug-field';
|
||||
import { toast } from '@/hooks/use-toast';
|
||||
import { Plus, Zap, Save, X } from 'lucide-react';
|
||||
import { toDateOnly } from '@/lib/dateUtils';
|
||||
import { useUnitPreferences } from '@/hooks/useUnitPreferences';
|
||||
import { useManufacturers, useRideModels } from '@/hooks/useAutocompleteData';
|
||||
import { useUserRole } from '@/hooks/useUserRole';
|
||||
@@ -493,7 +494,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
|
||||
value={watch('opening_date') ? new Date(watch('opening_date')) : undefined}
|
||||
precision={(watch('opening_date_precision') as DatePrecision) || 'day'}
|
||||
onChange={(date, precision) => {
|
||||
setValue('opening_date', date ? date.toISOString().split('T')[0] : undefined);
|
||||
setValue('opening_date', date ? toDateOnly(date) : undefined);
|
||||
setValue('opening_date_precision', precision);
|
||||
}}
|
||||
label="Opening Date"
|
||||
@@ -506,7 +507,7 @@ export function RideForm({ onSubmit, onCancel, initialData, isEditing = false }:
|
||||
value={watch('closing_date') ? new Date(watch('closing_date')) : undefined}
|
||||
precision={(watch('closing_date_precision') as DatePrecision) || 'day'}
|
||||
onChange={(date, precision) => {
|
||||
setValue('closing_date', date ? date.toISOString().split('T')[0] : undefined);
|
||||
setValue('closing_date', date ? toDateOnly(date) : undefined);
|
||||
setValue('closing_date_precision', precision);
|
||||
}}
|
||||
label="Closing Date (if applicable)"
|
||||
|
||||
Reference in New Issue
Block a user