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

When entering a date via keyboard in the YYYY-MM-DD format, the selected date is one day prior

Open chrisharrington opened this issue 5 years ago • 4 comments

Describe the bug When entering a date via keyboard in the YYYY-MM-DD format, the selected date is one day prior. For example, entering "2020-12-28" selects December 27th, 2020.

To Reproduce Steps to reproduce the behavior:

  1. Click on the date picker's input field.
  2. Input "2020-12-28" and hit enter.

Expected behavior The selected date should be December 28th, 2020. Instead, December 27th is selected.

Screenshots datepicker

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Brave
  • Version: Chromium 87.0.4280.101.

chrisharrington avatar Dec 31 '20 16:12 chrisharrington

For me this happened if I set this.state.date = null; and value={this.state.date}, but not if I set it to new Date(); etc.

bennjjii avatar Jan 02 '21 15:01 bennjjii

The same issue for me. YYYY/MM/DD works well. Any updates on this?

gunner13 avatar May 04 '21 05:05 gunner13

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 Mar 03 '22 05:03 stale[bot]

This is happening to me in the DD/MM/YYYY format too. I see this issue was marked as stale, but it's definitely not fixed in 7.3.0.

akamud avatar Sep 17 '24 01:09 akamud