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

showNeighboringMonth = false doesn't seem to work when coupled with showDoubleView #462

Closed
leolozes opened this issue Dec 2, 2020 · 11 comments
Labels

Comments

@leolozes
Copy link

leolozes commented Dec 2, 2020

First of all, thanks for the great component you've made!

I was doing some testing with these parameters, and the showNeighboringMonth parameter works as intended:

      <Calendar
        minDate={new Date()}
        selectRange={true}
        showNeighboringMonth={false}
        locale={"es"}
      />

image

However when coupling with showDoubleView, it doesn't seem to work:

      <Calendar
        minDate={new Date()}
        selectRange={true}
        showDoubleView={true}
        showNeighboringMonth={false}
        locale={"es"}
      />

image

Am I doing something wrong on my end?

Edit: found a workaround, by adding a css rule:

.react-calendar__month-view__days__day--neighboringMonth {
  display: none;
}
@leolozes leolozes changed the title showNeighboringMonth = false is not working when used with showDoubleView showNeighboringMonth = false doesn't seem to work when coupled with showDoubleView Dec 2, 2020
@lauterry
Copy link

Hi

I have the same issue as @leolozes

Thx for the workaround

@lauterry
Copy link

Hi

The documentation explains well why showNeighboringMonth = false doesn't seem to work when coupled with showDoubleView.

showDoubleView = true forces showFixedNumberOfWeeks = true which forces showNeighboringMonth = true

Capture d’écran 2021-01-26 à 15 06 09

@leolozes
Copy link
Author

You are right!
However I don't really see why this is enforced since the calendar seems to work fine with the css rule applied, and I think is what makes most sense. You don't really want to see the next month in the first calendar when you have just besides it.

I'd say is how most of the biggest websites work (and it's why I need it to be that way as well):

AirBNB

Trivago

Momondo

Booking

@lauterry
Copy link

Hi @leolozes

I'm totally agree with you.

Maybe the mainteners can explain why showNeighboringMonth is enforced to true when showDoubleView = true ?

Best regards !

@lauterry
Copy link

@leolozes

BTW, have you encountered the issue explained here #339 with the DoubleView Calendar ?

If so, how have you solved the pb ?

@lauterry
Copy link

lauterry commented Feb 3, 2021

Hi @leolozes

Your workaround is not totally right and caused this issue : #482

The correct workaround is :

.react-calendar__month-view__days__day--neighboringMonth {
  visibility: hidden;
}

Best regards

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

@github-actions github-actions bot added the stale label Aug 30, 2021
@github-actions
Copy link
Contributor

This issue was closed because it has been stalled for 14 days with no activity.

@ivanvanderbyl
Copy link

It'd be great to have a non-css workaround for this, since the css workaround causes other styling issues:
image

@J0914
Copy link

J0914 commented Sep 27, 2023

Can we come back to this please, this calendar is so great, but this one issue is very frustrating and I don't want to have to spend an hour trying to figure out a workaround, that's why I installed a package lolol this is the ONLY issue I have with this calendar. Could someone explain why you would want this functionality in the first place?

@kyle-ssg
Copy link

I can see why this would be desirable, but not at the end of month a and start of b. This is indeed a really frustrating issue and I echo that the lib is perfect except this.

I'm going to look for a way to patch this but messaging here in case anyone found a solution, hiding the dates in css is obviously flawed since you have a whole row of invisible days on some months.

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

No branches or pull requests

5 participants