medly / medly-components

🧩 Medly components provides numerous themable react components, each with multiple varitaions of sizes, colors, position etc.
https://medly.github.io/medly-components/
MIT License
79 stars 54 forks source link

bug: DateRangePicker calendar does not move ahead to the month of minSelectable date #727

Open Abg4real opened 1 year ago

Abg4real commented 1 year ago

Describe the bug

When the date range provided by minSelectableDate and maxSelectableDate does not contain today's date, or next month's date in case of 2-months-view, the calendar does not move to months of that date range.

To Reproduce

  1. Add minSelectable date of 3 months from today.
  2. When selecting the date, calendar shows disabled dates.
  3. In order to select a valid date, the calendar needs to be forwarded to minSelectable month.
  4. If the minSelectable and maxSelectable are a month earlier than today's date, the error still persists.

Expected behavior

If the selectable date range starts in the previous or later month, then that month should be shown by default, when calendar selection is opened.

Screenshots

image

Package versions