I'm trying to use the DateRangePicker for a dashboard where you select only past dates. Now I've found the way to reverse the outside range via #209 but I also want the initialVisibleMonth to start with the previous month + this month.
How do I use initialVisibleMonth to do so?
Hi @cheeminjun! You would do the following:
initialVisibleMonth={() => moment().subtract(1, 'month')}
You might also want to cache moment() in your constructor or somewhere similar so as to avoid creating a new moment object on every render.
Cheers!
Most helpful comment
Hi @cheeminjun! You would do the following:
You might also want to cache
moment()in your constructor or somewhere similar so as to avoid creating a new moment object on every render.