How can we set DateRangePicker
from the @wojtekmaj/react-daterange-picker
package to show only months (i.e. like a month picker) when the component is first clicked?
Tried using
JavaScript
x
7
1
<DateRangePicker
2
onChange={onChange}
3
value={value}
4
maxDetail="month"
5
calendarIcon={null}
6
/>
7
but it is opening up in the “day” view
instead of the “month” view
Advertisement
Answer
Your DateRangePicker options maxDetail value should be “year” instead of “month”.
JavaScript
1
6
1
<DateRangePicker
2
onChange={onChange}
3
value={value}
4
maxDetail="year"
5
/>
6