Skip to content

Setting a defaultMonth the next year when using the dropdown mode does not render the calendar. #2776

@drac94

Description

@drac94

Hey, not sure if this is a bug or a feature but setting a default month in the future (next year) when using the dropdown mode results in the calendar not being rendered, to solve it I need to add and end month but not sure if this is the correct way.

To reproduce

  • Just add a component with a default month the year after you are right now
import { DayPicker } from "react-day-picker";
import "react-day-picker/style.css";

export default function App() {
  return  (
    <DayPicker
        hideNavigation
        captionLayout="dropdown"
        defaultMonth={new Date("2026/07/05")}
      />
  )
}

CodeSandbox: https://codesandbox.io/p/sandbox/4zg6k5

Actual Behavior

Calendar is not rendered

Expected Behavior

Calendar should be rendered.

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