onesine / react-tailwindcss-datepicker

Modern date range picker component for React using Tailwind 3 and dayjs. Alternative to Litepie Datepicker.
https://react-tailwindcss-datepicker.vercel.app/
MIT License
552 stars 169 forks source link

Troubles with values #282

Open tomg55555 opened 1 month ago

tomg55555 commented 1 month ago

Hello there, first of all thanks for the work. I'm experiencing some troubles using the component as single date picker in a form. This is how my component looks like: <Datepicker displayFormat={"YYYY/MM/DD"} key={fields.startDate.key} asSingle={true} useRange={false} value={value} readOnly={true} inputName={fields.startDate.name} placeholder="Inserisci data di inizio" onChange={handleValueChange} />

The problem is that in form control I can handle both strings like "YYYY-MM-DD" or Date types but the value i got looks like this:

Screenshot 2024-09-25 alle 03 36 05

How can I got somthing like like "YYYY-MM-DD"?