Skip to content

Shows single month even when numberOfMonths is 2 #2782

@pdhruv93

Description

@pdhruv93

When the mode="range" and numberOfMonths="2", shows only one month when the range is within the last month.
If range includes more than 1month, works fine.

To reproduce

<DayPicker
      endMonth={new Date()}
      hidden={[{ after: new Date() }]}
      min={2}
      numberOfMonths={2}
      pagedNavigation={false}
      mode="range"
      selected={dates}
      onSelect={setDates}
      month={monthFocused}
      onMonthChange={(start) => setMonthFocused(start)}
    />

Actual Behavior

Shows only current month

Expected Behavior

Should show current month and previous month, since numberOfMonths is 2

Screenshots

Image
https://codesandbox.io/p/sandbox/3j5wmw

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions