Files
cartlog-admin/node_modules/react-date-range/src/components/DateRange/README.md
2026-01-01 15:25:19 +05:30

730 B

This component extends all the props of Calendar component. In addition to those props, it has the following props:

Prop Name Type
moveRangeOnFirstSelection boolean
retainEndDateOnFirstSelection boolean
onRangeFocusChange function
rangeColors array
ranges array

Example: Editable Date Inputs

import {useState} from 'react'
const [state, setState] = useState([
    {
      startDate: new Date(),
      endDate: null,
      key: 'selection'
    }
  ]);
  
<DateRange
  editableDateInputs={true}
  onChange={item => setState([item.selection])}
  moveRangeOnFirstSelection={false}
  ranges={state}
/>