hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.6k stars 678 forks source link

How can I show same months in DateRange component #329

Open wowremywang opened 4 years ago

wowremywang commented 4 years ago

Hi, thanks for building this package. This is great and helped us a lot.

Currently, I have one issue. I am showing a DateRange component below way.

const selectionRange = {
  startDate: new Date(),
  endDate: new Date(),
  key: 'selection',
}

<DateRange
                    months={2}
                    direction="horizontal"
                    moveRangeOnFirstSelection={false}
                    ranges={[selectionRange]}
                    className={dateRangeClass}
                    onChange={this.selectDateRange}
/>

But 2 months(12/2019, 01/2020) are showing. Is there any way to show the same months as (12/2019, 12/2019)? Thank you!

nerycordova commented 4 years ago

Hi @yu-coder , just curious as to what would be a use case for the scenario you describe?