React-calendar: Showing two months at a time for range selection

Created on 12 Jun 2018  路  10Comments  路  Source: wojtekmaj/react-calendar

Thanks for this awesome component. 馃帀 The no styling part makes this the best available solution for me. 鉂わ笍

I wanted to know if there is a way to show two months side by side for range view as generally, it makes sense if we are selecting a range.

I want something just like this.

screen shot 2018-06-12 at 11 36 09 pm

enhancement

Most helpful comment

Coming soon... 馃憖

obraz

All 10 comments

Hello,
I think that's an awesome idea! Shouldn't be super hard to implement, too. I'm afraid that at the moment I'm super busy in my personal life, but I'm definitely keeping this in my backlog.

Coming soon... 馃憖

obraz

Hi @wojtekmaj

Can a monthly rangepicker and yearly range picker also be achieved in new release???

Yes, absolutely. showDoubleView will show two months/years/decades/centuries side by side.

Hey @wojtekmaj
How you are implementing MonthView, YearView, DecadeView, CenturyView .
There is no demo code for these . Tried these as named export and default export , did not work for me.
I m using v3 beta.
If you could explain on how to achieve month range selector , i.e just 2 month range panels similar to showDoubleView in Calendar.
Thnx.

@jatindumka Use Calendar compononent, with prop showDoubleView + minDetail set to "month" if you don't want users to be able to select year/decade/century tanges.

Hi,

Is it possible to decouple the showDoubleView and the showFixedNumberOfWeeks? It actually causes some very weird behaviours like:

  1. complete next/prev weeks unnecessarily shown in the other view
  2. rangeStart/rangeEnd being shown twice in some scenarios

showDoubleView-showFixedNumberOfWeeks

Thank you anyway for the great component

It can be "hacked" with a bit of CSS but shouldn't it be better to just avoid it?

.react-calendar__month-view__days__day--neighboringMonth:nth-last-of-type(7),
.react-calendar__month-view__days__day--neighboringMonth:nth-last-of-type(7) ~ .react-calendar__month-view__days__day--neighboringMonth {
  display: none;
}

Cheers

Actually decoupling showFixedNumberOfWeeks would just remove the last row on the right column in your case. I don't see how that would help...

Regarding pt 2, using class .react-calendar__month-view__days__day--neighboringMonth you should be able to style range in neighboring month just fine.

I just hide all the.react-calendar__month-view__days__day--neighboringMonth days, problem solved. Thank you anyway for the component.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amansur picture amansur  路  6Comments

Muttakee31 picture Muttakee31  路  4Comments

andymj picture andymj  路  5Comments

guydewinton picture guydewinton  路  3Comments

tranvula picture tranvula  路  4Comments