Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openToDate causes month shifting #3779

Closed
Vitallek opened this issue Sep 27, 2022 · 1 comment
Closed

openToDate causes month shifting #3779

Vitallek opened this issue Sep 27, 2022 · 1 comment

Comments

@Vitallek
Copy link

Vitallek commented Sep 27, 2022

If you have provided DatePicker (it should display 3 month, current month at the last place)

<ReactDatePicker
  focusSelectedMonth={false}
  selectsRange
  inline
  monthsShown={3}
  showYearDropdown
  locale={ru}
  disabledKeyboardNavigation
  dateFormat={"dd/MM/yyyy"}
  onChange={(dates) => handleChangeDate(dates, setDateRange)}
  className={"datepicker-here form-control"}
  maxDate={today}
  openToDate={today - MONTH_UNIX * 2}
  startDate={dateRange.startDate}
  endDate={dateRange.endDate}
/>

And you try to click on selected day (if only one is selected) or the first of selected days (if many selected), all blocks would be shifted (in my case - 2 shifts)

Expected behavior
I expected return of date of clicked day

Screenshots
Before click:
before_datepicker
After click:
after datepicker

System

  • OS: [Win 10]
  • Browser [Edge]
  • Version [105.0.1343.50]
@yuki0410-dev
Copy link
Contributor

yuki0410-dev commented Oct 19, 2022

I am also having the same problem.
I attach the minimal code that reproduces.
https://codesandbox.io/s/react-datepicker-3779-qbb4z0

martijnrusschen added a commit that referenced this issue Jan 30, 2023
fix openToDate causes month shifting (#3779)
p-rogas pushed a commit to p-rogas/react-datepicker that referenced this issue Mar 22, 2023
p-rogas pushed a commit to p-rogas/react-datepicker that referenced this issue Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants