diff --git a/src/components/ui/DateTimeInput.tsx b/src/components/ui/DateTimeInput.tsx index 4628eca..9e2a9e4 100644 --- a/src/components/ui/DateTimeInput.tsx +++ b/src/components/ui/DateTimeInput.tsx @@ -1,6 +1,7 @@ 'use client'; import { Calendar } from 'lucide-react'; +import { useRef } from 'react'; import { formatDateForDateTimeInput, parseDateTimeInput, @@ -23,6 +24,8 @@ export function DateTimeInput({ className = '', onFocus, }: DateTimeInputProps) { + const inputRef = useRef(null); + const handleChange = (e: React.ChangeEvent) => { const newValue = e.target.value ? parseDateTimeInput(e.target.value) @@ -30,13 +33,22 @@ export function DateTimeInput({ onChange(newValue); }; + const handleCalendarClick = () => { + if (!disabled && inputRef.current) { + // Déclencher le calendrier natif du navigateur + inputRef.current.showPicker?.(); + } + }; + return (