Hello,
I just started using this library. My requirement involves with past dates only. So, I was able to configure the component to disable selecting future dates.
This is great, but when I click on the Calendar, it automatically loads current month and the next month. Since I already disabled all future dates from being selected, I think it'd be useful for my users to see current month + previous month by default.
I'm not really sure how to configure the DateRangePicker component for that. The closest I came across was to use numberOfMonths={1} but that's not exactly what I want because it's basically limiting the Calendar to display 1 months at a time.
Is there anything in the current implementation of this component that will allow me to configure what I described above? Maybe I missed something in the doc.
The initialVisibleMonth prop seems useful
thanks... I'll try that out.
@amimas initialVisibleMonth={() => moment().subtract(1, 'month')} should work as a param for <DateRangePicker
you'll need to require || import the moment pkg as well
@TamikoT is right! That should open it up to the expected month. :)
@TamikoT Thanks a lot for the snippet. It worked like a charm!!
Most helpful comment
@amimas
initialVisibleMonth={() => moment().subtract(1, 'month')}should work as aparamfor<DateRangePickeryou'll need to
require||importthemomentpkg as well