Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: fixedWeeks should display 6 weeks if month has 4 weeks #2585

Closed
oleynikovoleg opened this issue Nov 14, 2024 · 3 comments · Fixed by #2590
Closed

bug: fixedWeeks should display 6 weeks if month has 4 weeks #2585

oleynikovoleg opened this issue Nov 14, 2024 · 3 comments · Fixed by #2590
Assignees
Labels
bug Bug or Bug fixes

Comments

@oleynikovoleg
Copy link

oleynikovoleg commented Nov 14, 2024

Code

<DayPicker
  mode="single"
  selected={selectedDate}
  onSelect={handleDataChange}
  hidden={[
    { before: fromDate },
    { after: toDate }
  ]}
  month={selectedMonth}
  onMonthChange={setSelectedMonth}
  showOutsideDays
  fixedWeeks
/>

Expected Behavior

The calendar should consistently display 6 weeks per month when using the fixedWeeks prop, regardless of the month. This should ensure a uniform calendar layout, even for months with fewer than 6 weeks of visible days.

Actual Behavior

In some months, the fixedWeeks prop does not work as expected and displays only 5 weeks instead of 6. This occurs inconsistently, even when fixedWeeks is enabled. The issue is reproducible on the example page as well.

Screenshots

Screenshot 2024-11-14 at 12 30 07 PM Screenshot 2024-11-14 at 12 24 34 PM
@gpbl
Copy link
Owner

gpbl commented Nov 14, 2024

@oleynikovoleg interesting, thanks for the report. It looks like it happens only with February 2026 - i.e. when the 28-day month starts on Sunday. Could you confirm?

@oleynikovoleg
Copy link
Author

@gpbl Yes, that’s correct. It seems to occur in February 2026, then again in February 2037, and so on, whenever the month begins on a Sunday and has 28 days. Thanks for pointing that out!

@gpbl gpbl added the bug Bug or Bug fixes label Nov 14, 2024
@gpbl gpbl changed the title fixedWeeks Prop Not Displaying 6 Weeks Consistently bug: fixedWeeks should display 6 weeks when the month has just 4 week Nov 14, 2024
@gpbl gpbl changed the title bug: fixedWeeks should display 6 weeks when the month has just 4 week bug: fixedWeeks should display 6 weeks if month has 4 weeks Nov 14, 2024
@gpbl gpbl self-assigned this Nov 14, 2024
@bryce-fitzsimons
Copy link

Came here to report this bug, saw it's already been submitted.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants