hypeserver / react-date-range

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

Remove 'days up to today' on DefinedRange/DateRangePicker #362

Open Kevin-Carlos opened 4 years ago

Kevin-Carlos commented 4 years ago

Perhaps I'm missing something here, but nothing in the list of props appears to hide this and the 'days starting today' boxes.

If there isn't this would be a nice feature to have.

nerycordova commented 4 years ago

Hi @Kevin-Carlos , you can overwrite ranges using staticRanges and inputRanges properties. For example, if you don't want any inputRange, just pass an empty array to that property:

<DateRangePicker
              onChange={ (event) => { console.log(event) }}
              ranges={[{selection:{}}]}
              direction="horizontal"
              inputRanges = {[]}
          />

See demo here. Through these properties you can also define custom ranges, using this file as an example.

Kevin-Carlos commented 4 years ago

@nerychucuy That is a solution, however, why doesn't it accept null as a value (Typescript)? Passing an empty array still renders the div of where the input ranges would be.

nerycordova commented 4 years ago

@Kevin-Carlos , that's a good point. Will see if I can work on a PR to address that.

restuarifp commented 3 years ago
inputRanges = {[]}

I used this approach to remove input ranges. It (partially) works, as the container (.rdrDefinedRangesWrapper) still there and the space is affecting the rest of the style. Is there any way to also remove this container/wrapper?

Though, I simply use this workaround

.rdrDefinedRangesWrapper {
  display: none;
}