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

showOutsideDays is disabled 1st on month start always on Sunday #2036

Open
tyki6 opened this issue Jan 24, 2024 · 1 comment
Open

showOutsideDays is disabled 1st on month start always on Sunday #2036

tyki6 opened this issue Jan 24, 2024 · 1 comment
Assignees

Comments

@tyki6
Copy link

tyki6 commented Jan 24, 2024

Description

showOutsideDays is disabled 1st on month start always on Sunday

Expected Behavior

On february when showOutsideDays is disabled 1 february start on thursday and not on monday.

Actual Behavior

<DayPicker initialFocus showOutsideDays  mode="range" numberOfMonths={2} defaultMonth={new Date} />

image

<DayPicker initialFocus showOutsideDays={false}  mode="range" numberOfMonths={2} defaultMonth={new Date} />

image

Steps to Reproduce

show two month, in February.
code:

<DayPicker initialFocus showOutsideDays  mode="range" numberOfMonths={2} defaultMonth={new Date} />

Possible Solution

If you have a suggestion on how to fix the issue, please include it here.

Your Environment

  • React version: 18.2.0
  • Browser [e.g. chrome, safari]: on all browser
  • Operating System [e.g. iOS, Windows]: x86_64 GNU/Linux
  • Other relevant information: react-day-picker 8.10.0
@deka014
Copy link

deka014 commented Mar 20, 2024

I was facing the same issue. I solved it by fixing the css of the day picker table row (added justify-content-end css property). When we disable the showOutsideDays, the items are shifted towards left for the first row as there are less than seven <tr> in the first row

table: 'w-full border-collapse space-y-1', head_row: 'flex', head_cell: 'text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]', row: 'flex justify-end w-full mt-2', cell: 'text-center text-sm p-0 relative [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20'

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

No branches or pull requests

3 participants