<Datetime
timeFormat={false}
readOnly
className=”readonly block w-full mt-2 rounded-md border-0 text-gray-900 shadow-sm”
onChange={handleBirthdayChange}
onKeyDown={(event) => event.preventDefault()}
/>
I want to stop the error that occurs when I click the datetime and press a button on the keyboard.
I tried with readOnly,
Also tried with onKeyDown={(event) => event.preventDefault()}. But none of that worked.
error msg:
selectedDate.format is not a function
TypeError: selectedDate.format is not a function
Shanuka Dilshan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.