react-multi-date-picker icon indicating copy to clipboard operation
react-multi-date-picker copied to clipboard

Showing today's date as initial

Open DenizCansever opened this issue 3 years ago • 1 comments

Hello,

I am using only Calendar component from your work. I found interesting issue which I want to inform you. I have dates array from API. I set the array to the calendar as value prop. It works fine as functional. The problem is when we have value on Calendar component we can't see the today's month as initial. It shows first element of the date of value's array when site is rendered as a first time.

If I have value array like ["2009-11-22", "2022-01-04] , calendar shows the 11th month of 2009 as initial. But I want to see today's month and year as default like first render of page. I think you have done this without have any initial values from array.

This is the Calendar Component that I use. So as a conclusion when value array has initial values, calendar shows first element of that array when the site is rendered as a first time. But I think it needs to give today's date as initial.

This is the code which i use the Calendar Component.

<Calendar className="custom-calendar" multiple value={value} onChange={setValue} format="YYYY-MM-DD" />

DenizCansever avatar Jan 03 '22 14:01 DenizCansever

Sorry I found currentDate Prop <3 But I think calendar should show the todays date as initial.

DenizCansever avatar Jan 05 '22 08:01 DenizCansever