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

Default month selected when minimumDate after this month

Open Aryan-mor opened this issue 4 years ago • 4 comments

Describe the bug example Today is 2020-08-07 minimumDate : 2020-09-07

Default showing month 8 instead 9

Aryan-mor avatar Oct 21 '20 15:10 Aryan-mor

Hi I would like to contribute to his library. Is this really a bug? Or should we add a feature like this:

A boolean prop called something like "setDefaultMonthInRange". If true, when a minimum date after today and/or a maximum date before today is set, then when opened, the Calendar will by default display the month of the minimum date. If false the calendar will display the current month by default no matter the minimum/maximum date.

everas7 avatar Oct 30 '20 22:10 everas7

A feature definitely. Should be a prop.

radandt avatar Dec 14 '20 10:12 radandt

Spotted a workaround (not a solution):

Set return-value of getToday in locale to Day-object, you want to show up initially.

radandt avatar Dec 14 '20 10:12 radandt

Hope to hear the update on this feature.

My temporary solution is to set the initial value to minimumDate that will show the selected month.

keidarcy avatar May 24 '21 05:05 keidarcy