When clicked on the input box and type something valid, input will clear or some random date and time will assign to this input.
It is allowing me to select date or time with mouse. Whenever type, input will clear or assign random values.
<Datetime
value={moment(date)}
onChange={(date) => setDate(date)}
dateFormat="DD/MM/YYYY"
timeFormat="HH:mm:ss"
utc={true}
/>
When trying with "defaultValue" instead of "value", this will allow to type date or time but it will not appear the value of "date" which i passed through my react state.
<Datetime
defaultValue={moment(date)}
onChange={(date) => setDate(date)}
dateFormat="DD/MM/YYYY"
timeFormat="HH:mm:ss"
utc={true}
/>
Image Reference
- Version of react-datetime -> "react-datetime": "^2.16.3",