react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

Strange behaviour when dateFormat includes date and time

Open mxsmirnoff opened this issue 7 years ago • 1 comments

I made input with dateFormat that includes date and time formats and try to enter date without time.

Expected behavior

Clear input or format with date part of dateFormat

Actual behavior

In cases when dateFormat="dd/MM/yyyy HH:mm:ss" (with slashes) it clears input when dd > 12 and swap date and month when dd < 12. In cases when dateFormat="dd.MM.yyyy HH:mm:ss" (with dots) it always clears input Mar-18-2019 17-54-30

Steps to reproduce

react-datepicker v2.0.0

import DatePicker from 'react-datepicker';
...
<DatePicker
  id={code}
  selected={value}
  onChange={(date) => { this.setState({ value: date }); }}
  showTimeSelect
  timeFormat="HH:mm"
  dateFormat="dd/MM/yyyy HH:mm:ss"
/>

mxsmirnoff avatar Mar 18 '19 15:03 mxsmirnoff

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 25 '19 16:11 stale[bot]